puppet 3.0 fixes
This commit is contained in:
parent
26ebca9a5f
commit
eebd1512cf
5 changed files with 25 additions and 9 deletions
|
@ -30,14 +30,14 @@ SSLCipherSuite RC4-SHA:HIGH:!ADH
|
||||||
# the certificate is encrypted, then you will be prompted for a
|
# the certificate is encrypted, then you will be prompted for a
|
||||||
# pass phrase. Note that a kill -HUP will prompt again. A new
|
# pass phrase. Note that a kill -HUP will prompt again. A new
|
||||||
# certificate can be generated using the genkey(1) command.
|
# certificate can be generated using the genkey(1) command.
|
||||||
SSLCertificateFile <%= apache_ssldir %>/certs/<%= site_fqdn %>.crt
|
SSLCertificateFile <%= @apache_ssldir %>/certs/<%= site_fqdn %>.crt
|
||||||
|
|
||||||
# Server Private Key:
|
# Server Private Key:
|
||||||
# If the key is not combined with the certificate, use this
|
# If the key is not combined with the certificate, use this
|
||||||
# directive to point at the key file. Keep in mind that if
|
# directive to point at the key file. Keep in mind that if
|
||||||
# you've both a RSA and a DSA private key you can configure
|
# you've both a RSA and a DSA private key you can configure
|
||||||
# both in parallel (to also allow the use of DSA ciphers, etc.)
|
# both in parallel (to also allow the use of DSA ciphers, etc.)
|
||||||
SSLCertificateKeyFile <%= apache_ssldir %>/private/<%= site_fqdn %>.key
|
SSLCertificateKeyFile <%= @apache_ssldir %>/private/<%= site_fqdn %>.key
|
||||||
|
|
||||||
# Server Certificate Chain:
|
# Server Certificate Chain:
|
||||||
# Point SSLCertificateChainFile at a file containing the
|
# Point SSLCertificateChainFile at a file containing the
|
||||||
|
@ -47,7 +47,7 @@ SSLCertificateKeyFile <%= apache_ssldir %>/private/<%= site_fqdn %>.key
|
||||||
# when the CA certificates are directly appended to the server
|
# when the CA certificates are directly appended to the server
|
||||||
# certificate for convinience.
|
# certificate for convinience.
|
||||||
<% if ssl_chain != "" -%>
|
<% if ssl_chain != "" -%>
|
||||||
SSLCertificateChainFile <%= apache_ssldir %>/certs/<%= site_fqdn %>.chain.crt
|
SSLCertificateChainFile <%= @apache_ssldir %>/certs/<%= site_fqdn %>.chain.crt
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
# Certificate Authority (CA):
|
# Certificate Authority (CA):
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
#
|
#
|
||||||
# $firewall_custom = [ "pass in quick carp", ]
|
# $firewall_custom = [ "pass in quick carp", ]
|
||||||
#
|
#
|
||||||
|
# Loading of extra modules is supported on centos. For example FTP
|
||||||
|
# support for iptables:
|
||||||
|
#
|
||||||
|
# $firewall_modules = [ "nf_conntrack_ftp", ]
|
||||||
|
|
||||||
class firewall {
|
class firewall {
|
||||||
|
|
||||||
if ! $firewall_custom {
|
if ! $firewall_custom {
|
||||||
|
@ -25,6 +30,9 @@ class firewall {
|
||||||
if ! $firewall_rules {
|
if ! $firewall_rules {
|
||||||
$firewall_rules = []
|
$firewall_rules = []
|
||||||
}
|
}
|
||||||
|
if ! $firewall_modules {
|
||||||
|
$firewall_modules = []
|
||||||
|
}
|
||||||
|
|
||||||
case $operatingsystem {
|
case $operatingsystem {
|
||||||
centos,debian,fedora,ubuntu: {
|
centos,debian,fedora,ubuntu: {
|
||||||
|
@ -116,6 +124,14 @@ class firewall::common::iptables {
|
||||||
hasrestart => true,
|
hasrestart => true,
|
||||||
require => Package["iptables"],
|
require => Package["iptables"],
|
||||||
}
|
}
|
||||||
|
if $firewall_modules {
|
||||||
|
$firewall_modules_str = inline_template('\'"<%= @firewall_modules.join(" ") -%>"\'')
|
||||||
|
augeas { "iptables-config":
|
||||||
|
context => "/files/etc/sysconfig/iptables-config",
|
||||||
|
changes => [ "set IPTABLES_MODULES ${firewall_modules_str}" ],
|
||||||
|
notify => Service["iptables"],
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
-A INPUT -p ipv6-icmp -j ACCEPT
|
-A INPUT -p ipv6-icmp -j ACCEPT
|
||||||
<%
|
<%
|
||||||
firewall_rules.each do |rule|
|
@firewall_rules.each do |rule|
|
||||||
rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule)
|
rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule)
|
||||||
if not rule[3] or IPAddr.new(rule[3].strip()).ipv6?
|
if not rule[3] or IPAddr.new(rule[3].strip()).ipv6?
|
||||||
-%>
|
-%>
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<%
|
<%
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
firewall_custom.each do |rule|
|
@firewall_custom.each do |rule|
|
||||||
-%>
|
-%>
|
||||||
<%= rule %>
|
<%= rule %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||||
-A INPUT -p icmp --icmp-type any -j ACCEPT
|
-A INPUT -p icmp --icmp-type any -j ACCEPT
|
||||||
<%
|
<%
|
||||||
firewall_rules.each do |rule|
|
@firewall_rules.each do |rule|
|
||||||
rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule)
|
rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule)
|
||||||
if not rule[3] or IPAddr.new(rule[3].strip()).ipv4?
|
if not rule[3] or IPAddr.new(rule[3].strip()).ipv4?
|
||||||
-%>
|
-%>
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<%
|
<%
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
firewall_custom.each do |rule|
|
@firewall_custom.each do |rule|
|
||||||
-%>
|
-%>
|
||||||
<%= rule %>
|
<%= rule %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -8,10 +8,10 @@ pass out all
|
||||||
pass in quick inet proto icmp all
|
pass in quick inet proto icmp all
|
||||||
pass in quick inet6 proto icmp6 all
|
pass in quick inet6 proto icmp6 all
|
||||||
|
|
||||||
<% firewall_rules.each do |rule| -%>
|
<% @firewall_rules.each do |rule| -%>
|
||||||
<% rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule) -%>
|
<% rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule) -%>
|
||||||
pass in quick proto <%= rule[1] %><% if rule[3] %> from<%= rule[3] %><% end %> to port <%= rule[2] %>
|
pass in quick proto <%= rule[1] %><% if rule[3] %> from<%= rule[3] %><% end %> to port <%= rule[2] %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% firewall_custom.each do |rule| -%>
|
<% @firewall_custom.each do |rule| -%>
|
||||||
<%= rule %>
|
<%= rule %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Loading…
Add table
Reference in a new issue