mirror of
https://github.com/saltstack-formulas/bind-formula.git
synced 2025-04-16 17:50:23 +00:00
fix(rubocop): add fixes using rubocop -a --safe
[skip ci]
This commit is contained in:
parent
0dd9bd3b6a
commit
9d2966fd32
4 changed files with 149 additions and 146 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
# Set defaults, use debian as base
|
# Set defaults, use debian as base
|
||||||
|
|
||||||
conf_user = 'bind'
|
conf_user = 'bind'
|
||||||
|
@ -108,8 +109,8 @@ when 'arch','redhat', 'centos', 'fedora', 'amazon'
|
||||||
its('owner') { should eq conf_user }
|
its('owner') { should eq conf_user }
|
||||||
its('group') { should eq conf_group }
|
its('group') { should eq conf_group }
|
||||||
its('mode') { should cmp conf_mode }
|
its('mode') { should cmp conf_mode }
|
||||||
its('content') { should match /^include\ "\/etc\/named\.rfc1912\.zones";/ }
|
its('content') { should match %r{^include\ "/etc/named\.rfc1912\.zones";} }
|
||||||
its('content') { should match /^include\ "\/etc\/named\.conf\.local";/ }
|
its('content') { should match %r{^include\ "/etc/named\.conf\.local";} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
when 'ubuntu', 'debian'
|
when 'ubuntu', 'debian'
|
||||||
|
@ -119,8 +120,8 @@ when 'ubuntu', 'debian'
|
||||||
its('owner') { should eq conf_user }
|
its('owner') { should eq conf_user }
|
||||||
its('group') { should eq conf_group }
|
its('group') { should eq conf_group }
|
||||||
its('mode') { should cmp conf_mode }
|
its('mode') { should cmp conf_mode }
|
||||||
its('content') { should match /^include\ "\/etc\/bind\/named\.conf\.local";/ }
|
its('content') { should match %r{^include\ "/etc/bind/named\.conf\.local";} }
|
||||||
its('content') { should match /^include\ "\/etc\/bind\/named\.conf\.options";/ }
|
its('content') { should match %r{^include\ "/etc/bind/named\.conf\.options";} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -154,20 +155,20 @@ control 'File ' + config + '.local' do
|
||||||
# the #{foo} is a ruby string expansion so we can use the variables
|
# the #{foo} is a ruby string expansion so we can use the variables
|
||||||
# defined above
|
# defined above
|
||||||
# Match example.com zone from the pillar
|
# Match example.com zone from the pillar
|
||||||
its('content') { should match /^zone\ "example\.com"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}\/example\.com";\n\ \ \n\ \ update-policy\ {\n\ \ \ \ grant\ core_dhcp\ name\ dns_entry_allowed_to_update\.\ ANY;\n\ \ \};\n\ \ notify\ no;\n\};/ }
|
its('content') { should match %r{^zone\ "example\.com"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}/example\.com";\n\ \ \n\ \ update-policy\ {\n\ \ \ \ grant\ core_dhcp\ name\ dns_entry_allowed_to_update\.\ ANY;\n\ \ \};\n\ \ notify\ no;\n\};} }
|
||||||
# Match example.net from pillar
|
# Match example.net from pillar
|
||||||
its('content') { should match /^zone\ "example\.net"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}\/example\.net";\n\ \ \n\ \ notify\ no;\n\};/ }
|
its('content') { should match %r{^zone\ "example\.net"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}/example\.net";\n\ \ \n\ \ notify\ no;\n\};} }
|
||||||
# Match example.org from pillar
|
# Match example.org from pillar
|
||||||
its('content') { should match /^zone\ "example\.org"\ {\n\ \ type\ slave;\n\ \ file\ "#{zones_directory}\/";\n\ \ \n\ \ notify\ no;\n\ \ masters\ \{\n\ \ \ \ 192\.0\.2\.1;\n\ \ \ \ 192\.0\.2\.2;\n\ \ \};\n\};/ }
|
its('content') { should match %r{^zone\ "example\.org"\ {\n\ \ type\ slave;\n\ \ file\ "#{zones_directory}/";\n\ \ \n\ \ notify\ no;\n\ \ masters\ \{\n\ \ \ \ 192\.0\.2\.1;\n\ \ \ \ 192\.0\.2\.2;\n\ \ \};\n\};} }
|
||||||
# Match 113.0.203 reverse zone from pillar
|
# Match 113.0.203 reverse zone from pillar
|
||||||
its('content') { should match /^zone\ "113\.0\.203\.in-addr\.arpa"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}\/113\.0\.203\.in-addr\.arpa";\n\ \ \n\ \ notify\ no;\n\};/ }
|
its('content') { should match %r{^zone\ "113\.0\.203\.in-addr\.arpa"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}/113\.0\.203\.in-addr\.arpa";\n\ \ \n\ \ notify\ no;\n\};} }
|
||||||
# Match 100.51.198 reverse zone from pillar
|
# Match 100.51.198 reverse zone from pillar
|
||||||
its('content') { should match /^zone\ "100\.51\.198\.in-addr\.arpa"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}\/100\.51\.198\.in-addr\.arpa";\n\ \ \n\ \ notify\ no;\n\};/ }
|
its('content') { should match %r{^zone\ "100\.51\.198\.in-addr\.arpa"\ {\n\ \ type\ master;\n\ \ file\ "#{zones_directory}/100\.51\.198\.in-addr\.arpa";\n\ \ \n\ \ notify\ no;\n\};} }
|
||||||
# Match logging
|
# Match logging
|
||||||
its('content') { should match /^logging\ \{\n\ \ channel\ "querylog"\ {\n\ \ \ \ file\ "#{log_directory}\/query\.log";\n\ \ \ \ print-time\ yes;\n\ \ \};\n\ \ category\ queries\ \{\ querylog;\ \};\n\};/ }
|
its('content') { should match %r{^logging\ \{\n\ \ channel\ "querylog"\ {\n\ \ \ \ file\ "#{log_directory}/query\.log";\n\ \ \ \ print-time\ yes;\n\ \ \};\n\ \ category\ queries\ \{\ querylog;\ \};\n\};} }
|
||||||
# Match acl1
|
# Match acl1
|
||||||
its('content') { should match /acl\ client1\ \{\n\ \ 127\.0\.0\.0\/8;\n\ \ 10\.20\.0\.0\/16;\n\};/ }
|
its('content') { should match %r{acl\ client1\ \{\n\ \ 127\.0\.0\.0/8;\n\ \ 10\.20\.0\.0/16;\n\};} }
|
||||||
# Match acl2
|
# Match acl2
|
||||||
its('content') { should match /^acl\ client2\ \{\n\ \ 10\.30\.0\.0\/8;\n\};/ }
|
its('content') { should match %r{^acl\ client2\ \{\n\ \ 10\.30\.0\.0/8;\n\};} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
case os[:name]
|
case os[:name]
|
||||||
when 'arch'
|
when 'arch'
|
||||||
os_packages = %w(
|
os_packages = %w[
|
||||||
bind
|
bind
|
||||||
bind-tools
|
bind-tools
|
||||||
dnssec-tools
|
dnssec-tools
|
||||||
)
|
]
|
||||||
when 'redhat', 'centos', 'fedora', 'amazon'
|
when 'redhat', 'centos', 'fedora', 'amazon'
|
||||||
os_packages = %w(bind)
|
os_packages = %w[bind]
|
||||||
when 'suse', 'opensuse'
|
when 'suse', 'opensuse'
|
||||||
os_packages = %w(bind)
|
os_packages = %w[bind]
|
||||||
when 'debian', 'ubuntu'
|
when 'debian', 'ubuntu'
|
||||||
os_packages = %w(
|
os_packages = %w[
|
||||||
bind9
|
bind9
|
||||||
bind9utils
|
bind9utils
|
||||||
)
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
control 'Bind9 packages' do
|
control 'Bind9 packages' do
|
||||||
|
@ -26,4 +27,3 @@ control 'Bind9 packages' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
case os[:name]
|
case os[:name]
|
||||||
when 'arch', 'redhat', 'centos', 'fedora', 'amazon'
|
when 'arch', 'redhat', 'centos', 'fedora', 'amazon'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Set defaults, use debian as base
|
# Set defaults, use debian as base
|
||||||
|
|
||||||
conf_user = 'bind'
|
conf_user = 'bind'
|
||||||
|
@ -85,7 +87,7 @@ control 'File ' + zones_directory + '/example.net' do
|
||||||
# Match SOA
|
# Match SOA
|
||||||
its('content') { should match /^@\ IN\ SOA\ ns1.example.net\ hostmaster.example.net\ \(\n\ \ \ \ [0-9]{10}\ ;\ serial\n\ \ \ \ 12h\ ;\ refresh\n\ \ \ \ 300\ ;\ retry\n\ \ \ \ 2w\ ;\ expiry\n\ \ \ \ 1m\ ;\ nxdomain\ ttl\n\);/ }
|
its('content') { should match /^@\ IN\ SOA\ ns1.example.net\ hostmaster.example.net\ \(\n\ \ \ \ [0-9]{10}\ ;\ serial\n\ \ \ \ 12h\ ;\ refresh\n\ \ \ \ 300\ ;\ retry\n\ \ \ \ 2w\ ;\ expiry\n\ \ \ \ 1m\ ;\ nxdomain\ ttl\n\);/ }
|
||||||
# Match Include
|
# Match Include
|
||||||
its('content') { should match /^\$INCLUDE\ #{zones_directory}\/example\.net\.include$/ }
|
its('content') { should match %r{^\$INCLUDE\ #{zones_directory}/example\.net\.include$} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -141,7 +143,7 @@ control 'File ' + zones_directory + '/100.51.198.in-addr.arpa' do
|
||||||
# Match SOA
|
# Match SOA
|
||||||
its('content') { should match /^@\ IN\ SOA\ ns1.example.net\ hostmaster.example.net\ \(\n\ \ \ \ [0-9]{10}\ ;\ serial\n\ \ \ \ 12h\ ;\ refresh\n\ \ \ \ 600\ ;\ retry\n\ \ \ \ 2w\ ;\ expiry\n\ \ \ \ 1m\ ;\ nxdomain\ ttl\n\);/ }
|
its('content') { should match /^@\ IN\ SOA\ ns1.example.net\ hostmaster.example.net\ \(\n\ \ \ \ [0-9]{10}\ ;\ serial\n\ \ \ \ 12h\ ;\ refresh\n\ \ \ \ 600\ ;\ retry\n\ \ \ \ 2w\ ;\ expiry\n\ \ \ \ 1m\ ;\ nxdomain\ ttl\n\);/ }
|
||||||
# Match Include
|
# Match Include
|
||||||
its('content') { should match /^\$INCLUDE\ #{zones_directory}\/100\.51\.198\.in-addr\.arpa\.include$/ }
|
its('content') { should match %r{^\$INCLUDE\ #{zones_directory}/100\.51\.198\.in-addr\.arpa\.include$} }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -161,7 +163,6 @@ control 'File ' + zones_directory + '/100.51.198.in-addr.arpa.include' do
|
||||||
its('content') { should match '6.100.51.198.in-addr.arpa. PTR mx1.example.net.' }
|
its('content') { should match '6.100.51.198.in-addr.arpa. PTR mx1.example.net.' }
|
||||||
its('content') { should match '7.100.51.198.in-addr.arpa. PTR mx1.example.net.' }
|
its('content') { should match '7.100.51.198.in-addr.arpa. PTR mx1.example.net.' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue