Révision 8d22a441
WIP: Start adding support for Debian
manifests/init.pp | ||
---|---|---|
80 | 80 |
# @param rules |
81 | 81 |
# Specify hashes of `nftables::rule`s via hiera |
82 | 82 |
# |
83 |
# @param nftables_configuration_path |
|
84 |
# The absolute path to the principal nftables configuration file. |
|
85 |
# |
|
83 | 86 |
class nftables ( |
84 | 87 |
Boolean $in_ssh = true, |
85 | 88 |
Boolean $in_icmp = true, |
... | ... | |
99 | 102 |
Variant[Boolean[false], Pattern[/icmp(v6|x)? type .+|tcp reset/]] $reject_with = 'icmpx type port-unreachable', |
100 | 103 |
Variant[Boolean[false], Enum['mask']] $firewalld_enable = 'mask', |
101 | 104 |
Optional[Array[Pattern[/^(ip|ip6|inet)-[-a-zA-Z0-9_]+$/],1]] $noflush_tables = undef, |
105 |
Stdlib::AbsolutePath $nftables_configuration_path = '/etc/sysconfig/nftables.conf', |
|
102 | 106 |
) { |
103 | 107 |
package { 'nftables': |
104 | 108 |
ensure => installed, |
105 | 109 |
} -> file_line { |
106 | 110 |
'enable_nftables': |
107 | 111 |
line => 'include "/etc/nftables/puppet.nft"', |
108 |
path => '/etc/sysconfig/nftables.conf',
|
|
112 |
path => $nftables_configuration_path,
|
|
109 | 113 |
notify => Service['nftables'], |
110 | 114 |
} -> file { |
111 | 115 |
default: |
112 | 116 |
owner => 'root', |
113 | 117 |
group => 'root', |
114 | 118 |
mode => '0640'; |
119 |
'/etc/nftables': |
|
120 |
ensure => directory, |
|
121 |
mode => '0750'; |
|
115 | 122 |
'/etc/nftables/puppet-preflight': |
116 | 123 |
ensure => directory, |
117 | 124 |
mode => '0750', |
... | ... | |
149 | 156 |
systemd::dropin_file { 'puppet_nft.conf': |
150 | 157 |
ensure => present, |
151 | 158 |
unit => 'nftables.service', |
152 |
content => file('nftables/systemd/puppet_nft.conf'), |
|
159 |
content => file( |
|
160 |
"nftables/systemd/puppet_nft.${facts['os']['family']}.conf", |
|
161 |
'nftables/systemd/puppet_nft.conf' |
|
162 |
), |
|
153 | 163 |
notify => Service['nftables'], |
154 | 164 |
} |
155 | 165 |
|
Formats disponibles : Unified diff