Skip to content

Commit 3b13497

Browse files
dtapiacljhoblitt
authored andcommitted
(cluster/yepun) convert rke1 -> rke2
1 parent ed089a9 commit 3b13497

File tree

3 files changed

+178
-6
lines changed

3 files changed

+178
-6
lines changed

hieradata/cluster/yepun.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,96 @@
22
clustershell::groupmembers:
33
yepun: {group: "yepun", member: "yepun[01-05]"}
44
tuned::active_profile: "latency-performance"
5+
nm::conf:
6+
device:
7+
keep-configuration: "no"
8+
allowed-connections: "except:origin:nm-initrd-generator"
9+
10+
nm::connections:
11+
eno1np0:
12+
content:
13+
connection:
14+
id: "eno1np0"
15+
uuid: "3e516a55-fffc-44ab-828c-5ca7b17c7bbf"
16+
type: "ethernet"
17+
interface-name: "eno1np0"
18+
master: "bond0"
19+
slave-type: "bond"
20+
ethernet: {}
21+
ipv4:
22+
method: "disabled"
23+
ipv6:
24+
method: "disabled"
25+
eno2np1:
26+
content:
27+
connection:
28+
id: "eno2np1"
29+
uuid: "20178b7c-af05-4235-929b-fb2c4126e234"
30+
type: "ethernet"
31+
interface-name: "eno2np1"
32+
master: "bond0"
33+
slave-type: "bond"
34+
ethernet: {}
35+
ipv4:
36+
method: "disabled"
37+
ipv6:
38+
method: "disabled"
39+
bond0:
40+
content:
41+
connection:
42+
id: "bond0"
43+
uuid: "9dbf4a45-880a-491d-83cc-275db7197980"
44+
type: "bond"
45+
interface-name: "bond0"
46+
ethernet:
47+
cloned-mac-address: "%{facts.networking.interfaces.eno1np0.mac}"
48+
bond:
49+
mode: "802.3ad"
50+
miimon: "100"
51+
xmit_hash_policy: "layer3+4"
52+
ipv4:
53+
method: "disabled"
54+
ipv6:
55+
method: "disabled"
56+
bond0.1101:
57+
content:
58+
connection:
59+
id: "bond0.1101"
60+
uuid: "4f98595d-f363-40f1-b4c1-5a87f63d0f4a"
61+
type: "vlan"
62+
interface-name: "bond0.1101"
63+
master: "br1101"
64+
slave-type: "bridge"
65+
ethernet: {}
66+
vlan:
67+
flags: "1"
68+
id: "1101"
69+
parent: "bond0"
70+
bridge-port: {}
71+
br1101:
72+
content:
73+
connection:
74+
id: "br1101"
75+
uuid: "b5c7a6ef-b449-4729-b944-ec45c40b40cc"
76+
type: "bridge"
77+
interface-name: "br1101"
78+
ethernet: {}
79+
bridge:
80+
stp: "false"
81+
ipv4:
82+
method: "auto"
83+
ipv6:
84+
method: "disabled"
85+
proxy: {}
86+
enp71s0f3u1u1c2:
87+
content:
88+
connection:
89+
id: "enp71s0f3u1u1c2"
90+
type: "ethernet"
91+
autoconnect: "false"
92+
interface-name: "enp71s0f3u1u1c2"
93+
ethernet: {}
94+
ipv4:
95+
method: "disabled"
96+
ipv6:
97+
method: "disabled"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
classes:
3+
- "profile::core::sysctl::rp_filter"
4+
profile::core::sysctl::rp_filter::enable: false
5+
rke2::config:
6+
node-label:
7+
- "role=storage-node"

spec/hosts/nodes/yepun01.cp.lsst.org_spec.rb

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
end
2323
let(:node_params) do
2424
{
25-
role: 'rke',
25+
role: 'rke2server',
2626
site: 'cp',
2727
cluster: 'yepun',
2828
}
2929
end
3030

3131
it { is_expected.to compile.with_all_deps }
3232

33-
include_examples 'docker', docker_version: '25.0.3'
3433
include_examples 'baremetal'
3534
include_context 'with nm interface'
3635
include_examples 'ceph cluster'
@@ -47,13 +46,86 @@
4746
end
4847

4948
it do
50-
is_expected.to contain_class('rke').with(
51-
version: '1.8.0',
52-
checksum: '8815da0452ae14a45566b534c48a2af6286ee73f800208ba6ec59188cb9a8d25'
49+
is_expected.to contain_class('rke2').with(
50+
node_type: 'server',
51+
release_series: '1.32',
52+
version: '1.32.2~rke2r1'
5353
)
5454
end
5555

56-
it { is_expected.to have_nm__connection_resource_count(0) }
56+
it do
57+
expect(catalogue.resource('class', 'nm')[:conf]).to include(
58+
'device' => {
59+
'keep-configuration' => 'no',
60+
'allowed-connections' => 'except:origin:nm-initrd-generator',
61+
}
62+
)
63+
end
64+
65+
it { is_expected.to have_nm__connection_resource_count(6) }
66+
67+
%w[
68+
enp71s0f3u1u1c2
69+
].each do |i|
70+
context "with #{i}" do
71+
let(:interface) { i }
72+
73+
it_behaves_like 'nm disabled interface'
74+
end
75+
end
76+
77+
%w[
78+
eno1np0
79+
eno2np1
80+
].each do |i|
81+
context "with #{i}" do
82+
let(:interface) { i }
83+
84+
it_behaves_like 'nm named interface'
85+
it_behaves_like 'nm ethernet interface'
86+
it_behaves_like 'nm no-ip interface'
87+
it { expect(nm_keyfile['connection']['master']).to eq('bond0') }
88+
it { expect(nm_keyfile['connection']['slave-type']).to eq('bond') }
89+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
90+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv4\]$}) }
91+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv6\]$}) }
92+
end
93+
end
94+
95+
context 'with bond0' do
96+
let(:interface) { 'bond0' }
97+
98+
it_behaves_like 'nm named interface'
99+
it_behaves_like 'nm no-ip interface'
100+
it { expect(nm_keyfile['connection']['type']).to eq('bond') }
101+
it { expect(nm_keyfile['bond']['miimon']).to eq(100) }
102+
it { expect(nm_keyfile['bond']['mode']).to eq('802.3ad') }
103+
it { expect(nm_keyfile['bond']['xmit_hash_policy']).to eq('layer3+4') }
104+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
105+
it { expect(nm_keyfile_raw).not_to match(%r{^\[proxy\]$}) }
106+
end
107+
108+
%w[
109+
1101
110+
].each do |vlan|
111+
iface = "bond0.#{vlan}"
112+
113+
context "with #{iface}" do
114+
let(:interface) { iface }
115+
116+
it_behaves_like 'nm enabled interface'
117+
it_behaves_like 'nm vlan interface', id: vlan.to_i, parent: 'bond0'
118+
it_behaves_like 'nm bridge slave interface', master: "br#{vlan}"
119+
end
120+
end
121+
122+
context 'with br1101' do
123+
let(:interface) { 'br1101' }
124+
125+
it_behaves_like 'nm enabled interface'
126+
it_behaves_like 'nm bridge interface'
127+
it_behaves_like 'nm dhcp interface'
128+
end
57129
end # on os
58130
end # on_supported_os
59131
end

0 commit comments

Comments
 (0)