diff --git a/hieradata/node/dns1.cp.lsst.org.yaml b/hieradata/node/dns1.cp.lsst.org.yaml index 3d7ff1d325..19b90e6795 100644 --- a/hieradata/node/dns1.cp.lsst.org.yaml +++ b/hieradata/node/dns1.cp.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "139.229.160.53" diff --git a/hieradata/node/dns1.dev.lsst.org.yaml b/hieradata/node/dns1.dev.lsst.org.yaml new file mode 100644 index 0000000000..17b9ff5107 --- /dev/null +++ b/hieradata/node/dns1.dev.lsst.org.yaml @@ -0,0 +1,4 @@ +--- +network::interfaces_hash: + "%{networking.primary}": # fqdn + ipaddress: "139.229.134.53" diff --git a/hieradata/node/dns1.ls.lsst.org.yaml b/hieradata/node/dns1.ls.lsst.org.yaml index 7d81d194df..398703a1b3 100644 --- a/hieradata/node/dns1.ls.lsst.org.yaml +++ b/hieradata/node/dns1.ls.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "139.229.135.53" diff --git a/hieradata/node/dns1.tu.lsst.org.yaml b/hieradata/node/dns1.tu.lsst.org.yaml index 00529d8d22..02891b766f 100644 --- a/hieradata/node/dns1.tu.lsst.org.yaml +++ b/hieradata/node/dns1.tu.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "140.252.146.71" diff --git a/hieradata/node/dns2.ls.lsst.org.yaml b/hieradata/node/dns2.ls.lsst.org.yaml index ccaa0736a1..9bcbab607a 100644 --- a/hieradata/node/dns2.ls.lsst.org.yaml +++ b/hieradata/node/dns2.ls.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "139.229.135.54" diff --git a/hieradata/node/dns2.tu.lsst.org.yaml b/hieradata/node/dns2.tu.lsst.org.yaml index ddf75c5ced..749cd184db 100644 --- a/hieradata/node/dns2.tu.lsst.org.yaml +++ b/hieradata/node/dns2.tu.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "140.252.146.72" diff --git a/hieradata/node/dns3.cp.lsst.org.yaml b/hieradata/node/dns3.cp.lsst.org.yaml index 231f28938e..7e05abb5f9 100644 --- a/hieradata/node/dns3.cp.lsst.org.yaml +++ b/hieradata/node/dns3.cp.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "139.229.160.55" diff --git a/hieradata/node/dns3.ls.lsst.org.yaml b/hieradata/node/dns3.ls.lsst.org.yaml index db8c781299..2dae7589c3 100644 --- a/hieradata/node/dns3.ls.lsst.org.yaml +++ b/hieradata/node/dns3.ls.lsst.org.yaml @@ -1,4 +1,4 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "139.229.135.55" diff --git a/hieradata/node/dns3.tu.lsst.org.yaml b/hieradata/node/dns3.tu.lsst.org.yaml index 03ba2a06f9..26220986b7 100644 --- a/hieradata/node/dns3.tu.lsst.org.yaml +++ b/hieradata/node/dns3.tu.lsst.org.yaml @@ -1,5 +1,5 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn ipaddress: "140.252.146.73" domain: "tu.lsst.org" diff --git a/hieradata/site/cp/role/dnscache.yaml b/hieradata/site/cp/role/dnscache.yaml index 98ede21092..c37db3633e 100644 --- a/hieradata/site/cp/role/dnscache.yaml +++ b/hieradata/site/cp/role/dnscache.yaml @@ -1,6 +1,6 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn bootproto: "none" defroute: "yes" dns1: "%{lookup('dhcp::nameservers.0')}" diff --git a/hieradata/site/dev/role/dnscache.yaml b/hieradata/site/dev/role/dnscache.yaml new file mode 100644 index 0000000000..d3abcee8cd --- /dev/null +++ b/hieradata/site/dev/role/dnscache.yaml @@ -0,0 +1,13 @@ +--- +network::interfaces_hash: + "%{networking.primary}": # fqdn + bootproto: "none" + defroute: "yes" + dns1: "%{lookup('dhcp::nameservers.0')}" + dns2: "%{lookup('dhcp::nameservers.1')}" + domain: "%{lookup('dhcp::dnsdomain.0')}" + gateway: "139.229.134.254" + netmask: "255.255.255.0" + nozeroconf: "yes" + onboot: "yes" + type: "Ethernet" diff --git a/hieradata/site/ls/role/dnscache.yaml b/hieradata/site/ls/role/dnscache.yaml index 7fa5192f49..2c36d5c1ac 100644 --- a/hieradata/site/ls/role/dnscache.yaml +++ b/hieradata/site/ls/role/dnscache.yaml @@ -1,6 +1,6 @@ --- network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn bootproto: "none" defroute: "yes" dns1: "%{lookup('dhcp::nameservers.0')}" diff --git a/hieradata/site/tu/role/dnscache.yaml b/hieradata/site/tu/role/dnscache.yaml index ab988b66ab..c5e63890c5 100644 --- a/hieradata/site/tu/role/dnscache.yaml +++ b/hieradata/site/tu/role/dnscache.yaml @@ -7,7 +7,7 @@ dns::allow_recursion: dns::zones: ~ network::interfaces_hash: - eth0: # fqdn + "%{networking.primary}": # fqdn bootproto: "none" defroute: "yes" dns1: "%{lookup('dhcp::nameservers.0')}" diff --git a/spec/hosts/nodes/dns1.cp.lsst.org_spec.rb b/spec/hosts/nodes/dns1.cp.lsst.org_spec.rb new file mode 100644 index 0000000000..8097b65f9f --- /dev/null +++ b/spec/hosts/nodes/dns1.cp.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns1.cp.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns1.cp.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'cp', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.160.53', + gateway: '139.229.160.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns1.dev.lsst.org_spec.rb b/spec/hosts/nodes/dns1.dev.lsst.org_spec.rb new file mode 100644 index 0000000000..9fb052c5d7 --- /dev/null +++ b/spec/hosts/nodes/dns1.dev.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns1.dev.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns1.dev.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'dev', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.134.53', + gateway: '139.229.134.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns1.ls.lsst.org_spec.rb b/spec/hosts/nodes/dns1.ls.lsst.org_spec.rb new file mode 100644 index 0000000000..37de232f49 --- /dev/null +++ b/spec/hosts/nodes/dns1.ls.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns1.ls.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns1.ls.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'ls', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.135.53', + gateway: '139.229.135.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns1.tu.lsst.org_spec.rb b/spec/hosts/nodes/dns1.tu.lsst.org_spec.rb new file mode 100644 index 0000000000..df9c429ae3 --- /dev/null +++ b/spec/hosts/nodes/dns1.tu.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns1.tu.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns1.tu.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'tu', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '140.252.146.71', + gateway: '140.252.146.65', + netmask: '255.255.255.224', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns2.cp.lsst.org_spec.rb b/spec/hosts/nodes/dns2.cp.lsst.org_spec.rb new file mode 100644 index 0000000000..cef8fd5af0 --- /dev/null +++ b/spec/hosts/nodes/dns2.cp.lsst.org_spec.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns2.cp.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) { 'ens192' } + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns2.cp.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'cp', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.160.54', + gateway: '139.229.160.254', + netmask: '255.255.255.0', + ) + end + + it do + is_expected.to contain_network__interface('ens32').with( + ipaddress: '192.168.251.241', + netmask: '255.255.255.0', + gateway: '192.168.251.1', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns2.ls.lsst.org_spec.rb b/spec/hosts/nodes/dns2.ls.lsst.org_spec.rb new file mode 100644 index 0000000000..3cb6c11868 --- /dev/null +++ b/spec/hosts/nodes/dns2.ls.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns2.ls.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns2.ls.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'ls', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.135.54', + gateway: '139.229.135.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns2.tu.lsst.org_spec.rb b/spec/hosts/nodes/dns2.tu.lsst.org_spec.rb new file mode 100644 index 0000000000..183f54079c --- /dev/null +++ b/spec/hosts/nodes/dns2.tu.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns2.tu.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns2.tu.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'tu', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '140.252.146.72', + gateway: '140.252.146.65', + netmask: '255.255.255.224', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns3.cp.lsst.org_spec.rb b/spec/hosts/nodes/dns3.cp.lsst.org_spec.rb new file mode 100644 index 0000000000..173400449c --- /dev/null +++ b/spec/hosts/nodes/dns3.cp.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns3.cp.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns3.cp.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'cp', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.160.55', + gateway: '139.229.160.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns3.ls.lsst.org_spec.rb b/spec/hosts/nodes/dns3.ls.lsst.org_spec.rb new file mode 100644 index 0000000000..9677fd074b --- /dev/null +++ b/spec/hosts/nodes/dns3.ls.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns3.ls.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns3.ls.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'ls', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '139.229.135.55', + gateway: '139.229.135.254', + netmask: '255.255.255.0', + ) + end + end # on os + end # on_supported_os +end diff --git a/spec/hosts/nodes/dns3.tu.lsst.org_spec.rb b/spec/hosts/nodes/dns3.tu.lsst.org_spec.rb new file mode 100644 index 0000000000..ab90b02033 --- /dev/null +++ b/spec/hosts/nodes/dns3.tu.lsst.org_spec.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'dns3.tu.lsst.org', :site do + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:primary) do + if (facts[:os]['family'] == 'RedHat') && (facts[:os]['release']['major'] == '7') + 'eth0' + else + 'ens192' + end + end + + let(:facts) do + facts[:networking]['primary'] = primary + facts.merge( + fqdn: 'dns3.tu.lsst.org', + ) + end + + let(:node_params) do + { + role: 'dnscache', + site: 'tu', + } + end + + it { is_expected.to compile.with_all_deps } + + it do + is_expected.to contain_network__interface(primary).with( + ipaddress: '140.252.146.73', + gateway: '140.252.146.65', + netmask: '255.255.255.224', + ) + end + end # on os + end # on_supported_os +end