Révision 008c95d7
Add Debian support
spec/classes/nftables_spec.rb | ||
---|---|---|
15 | 15 |
else |
16 | 16 |
'/usr/sbin/nft' |
17 | 17 |
end |
18 |
nft_config = case os_facts[:os]['family'] |
|
19 |
when 'RedHat' |
|
20 |
'/etc/sysconfig/nftables.conf' |
|
21 |
else |
|
22 |
'/etc/nftables.conf' |
|
23 |
end |
|
18 | 24 |
|
19 | 25 |
it { is_expected.to compile.with_all_deps } |
20 | 26 |
|
... | ... | |
89 | 95 |
) |
90 | 96 |
} |
91 | 97 |
|
92 |
if os_facts[:os]['family'] == 'Archlinux' |
|
93 |
it { |
|
94 |
expect(subject).to contain_systemd__dropin_file('puppet_nft.conf').with( |
|
95 |
content: %r{^ExecReload=#{nft_path} -I /etc/nftables/puppet -f /etc/nftables.conf$} |
|
96 |
) |
|
97 |
} |
|
98 |
it { |
|
99 |
expect(subject).to contain_systemd__dropin_file('puppet_nft.conf').with( |
|
100 |
content: %r{^ExecReload=#{nft_path} -I /etc/nftables/puppet -f #{nft_config}$} |
|
101 |
) |
|
102 |
} |
|
103 |
|
|
104 |
case os_facts[:os]['family'] |
|
105 |
when 'Archlinux' |
|
98 | 106 |
|
99 | 107 |
it { |
100 | 108 |
expect(subject).to contain_service('firewalld').with( |
... | ... | |
102 | 110 |
enable: false |
103 | 111 |
) |
104 | 112 |
} |
105 |
else
|
|
113 |
when 'Debian'
|
|
106 | 114 |
it { |
107 |
expect(subject).to contain_systemd__dropin_file('puppet_nft.conf').with( |
|
108 |
content: %r{^ExecReload=#{nft_path} -I /etc/nftables/puppet -f /etc/sysconfig/nftables.conf$} |
|
115 |
is_expected.to contain_service('firewalld').with( |
|
116 |
ensure: 'stopped', |
|
117 |
enable: false |
|
109 | 118 |
) |
110 | 119 |
} |
111 |
|
|
120 |
else |
|
112 | 121 |
it { |
113 | 122 |
expect(subject).to contain_service('firewalld').with( |
114 | 123 |
ensure: 'stopped', |
Formats disponibles : Unified diff