Skip to content

Commit

Permalink
Merge pull request #1122 from lsst-it/IT-3056/rancher.cp
Browse files Browse the repository at this point in the history
(site/cp/cluster/rancher) add network config
  • Loading branch information
jhoblitt authored Apr 11, 2024
2 parents 06a70f5 + f7f759b commit e7c38ff
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
26 changes: 26 additions & 0 deletions hieradata/site/cp/cluster/rancher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
nm::connections:
enp1s0: # fqdn
content:
connection:
id: "enp1s0"
uuid: "a79e6dc7-7679-3237-a351-49132a22e919"
type: "ethernet"
interface-name: "enp1s0"
ethernet: {}
ipv4:
method: "auto"
ipv6:
method: "disabled"
enp2s0:
content:
connection:
id: "enp2s0"
uuid: "f6785b81-b268-3d77-bd7a-5833f9851108"
type: "ethernet"
interface-name: "enp2s0"
ethernet: {}
ipv4:
method: "disabled"
ipv6:
method: "disabled"
4 changes: 4 additions & 0 deletions hieradata/site/cp/cluster/rancher/role/rke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
classes:
- "profile::core::sysctl::rp_filter"
profile::core::sysctl::rp_filter::enable: false
24 changes: 23 additions & 1 deletion spec/hosts/nodes/rancher01.cp.lsst.org_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,29 @@
end

include_examples 'vm'
it { is_expected.to have_nm__connection_resource_count(0) }
include_context 'with nm interface'
it do
is_expected.to contain_class('profile::core::sysctl::rp_filter').with_enable(false)
end

it { is_expected.to have_nm__connection_resource_count(2) }

context 'with enp1s0' do
let(:interface) { 'enp1s0' }

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it_behaves_like 'nm dhcp interface'
end

context 'with enp2s0' do
let(:interface) { 'enp2s0' }

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it { expect(nm_keyfile['ipv4']['method']).to eq('disabled') }
it { expect(nm_keyfile['ipv6']['method']).to eq('disabled') }
end
end # on os
end # on_supported_os
end
3 changes: 1 addition & 2 deletions spec/hosts/nodes/rancher01.ls.lsst.org_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@

it_behaves_like 'nm enabled interface'
it_behaves_like 'nm ethernet interface'
it { expect(nm_keyfile['ipv4']['method']).to eq('auto') }
it { expect(nm_keyfile['ipv6']['method']).to eq('disabled') }
it_behaves_like 'nm dhcp interface'
end

context 'with enp2s0' do
Expand Down

0 comments on commit e7c38ff

Please sign in to comment.