Commit f657029 1 parent 4c6de92 commit f657029 Copy full SHA for f657029
File tree 4 files changed +32
-1
lines changed
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 24
24
end
25
25
26
26
# This should be the first rule now
27
- iptables_rule 'Allow from loopback interface' do
27
+ iptables_rule 'Allow from ethernet interface' do
28
28
table :filter
29
29
chain :INPUT
30
30
ip_version 'ipv4'
Original file line number Diff line number Diff line change 8
8
action :enable
9
9
delayed_action :start
10
10
11
+ cookbook 'test'
12
+ sensitive false
13
+
11
14
subscribes :restart , 'template[/etc/sysconfig/iptables]' , :delayed
12
15
subscribes :restart , 'template[/etc/iptables/rules.v4]' , :delayed
13
16
end
Original file line number Diff line number Diff line change
1
+ # Generated by Chef Infra Client
2
+ # Do NOT modify this file by hand.
3
+ #
4
+ # I'm from the test cookbook
5
+ #
6
+
7
+ <% unless nil_or_empty?(@iptables) -%>
8
+ <% @iptables.each do |table, data| -%>
9
+ <% next if nil_or_empty?(data) -%>
10
+ *<%= table %>
11
+ <% unless nil_or_empty?(data[:chains]) -%>
12
+ <% data[:chains].each do |chain, value| -%>
13
+ :<%= chain %> <%= value %>
14
+ <% end -%>
15
+ <% end -%>
16
+ <% unless nil_or_empty?(data[:rules]) -%>
17
+ <% data[:rules].each do |rule| -%>
18
+ <%= rule %>
19
+ <% end -%>
20
+ <% end -%>
21
+ COMMIT
22
+
23
+ <% end -%>
24
+ <% end -%>
Original file line number Diff line number Diff line change 2
2
when 'debian' , 'ubuntu'
3
3
describe file ( '/etc/iptables/rules.v4' ) do
4
4
it { should exist }
5
+ its ( :content ) { should match /# I'm from the test cookbook/ }
5
6
end
6
7
describe service ( 'netfilter-persistent' ) do
7
8
it { should be_installed }
8
9
it { should be_running }
9
10
it { should be_enabled }
10
11
end
11
12
when 'redhat' , 'fedora'
13
+ describe file ( '/etc/sysconfig/iptables' ) do
14
+ its ( :content ) { should match /# I'm from the test cookbook/ }
15
+ end
12
16
describe file ( '/etc/sysconfig/iptables-config' ) do
13
17
its ( :content ) { should match /IPTABLES_STATUS_VERBOSE="no"/ }
14
18
end
You can’t perform that action at this time.
0 commit comments