Skip to content

Commit d80ad13

Browse files
committed
(merken) Provision Cluster
1 parent 58df327 commit d80ad13

File tree

3 files changed

+232
-0
lines changed

3 files changed

+232
-0
lines changed

hieradata/cluster/merken.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
clustershell::groupmembers:
3+
merken: {group: "merken", member: "merken[01-04]"}
4+
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+
enp65s0f0:
12+
content:
13+
connection:
14+
id: "enp65s0f0"
15+
uuid: "3B53A7A8-94A2-4612-AB5B-65A3FAFE5DE1"
16+
type: "ethernet"
17+
interface-name: "enp65s0f0"
18+
master: "bond0"
19+
slave-type: "bond"
20+
ethernet: {}
21+
ipv4:
22+
method: "disabled"
23+
ipv6:
24+
method: "disabled"
25+
enp65s0f1:
26+
content:
27+
connection:
28+
id: "enp65s0f1"
29+
uuid: "28ac7f8a5-48e2-4d1b-b17c-103d4ab4c951"
30+
type: "ethernet"
31+
interface-name: "enp65s0f1"
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: "b9c03f5b-adab-4857-8f73-0f7599656a62"
44+
type: "bond"
45+
interface-name: "bond0"
46+
ethernet:
47+
cloned-mac-address: "%{facts.networking.interfaces.enp65s0f0.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.1131:
57+
content:
58+
connection:
59+
id: "bond0.1131"
60+
uuid: "4f98595d-f363-40f1-b4c1-5a87f63d0f4a"
61+
type: "vlan"
62+
interface-name: "bond0.1131"
63+
master: "br1131"
64+
slave-type: "bridge"
65+
ethernet: {}
66+
vlan:
67+
flags: "1"
68+
id: "1131"
69+
parent: "bond0"
70+
bridge-port: {}
71+
br1131:
72+
content:
73+
connection:
74+
id: "br1131"
75+
uuid: "b5c7a6ef-b449-4729-b944-ec45c40b40cc"
76+
type: "bridge"
77+
interface-name: "br1131"
78+
ethernet: {}
79+
bridge:
80+
stp: "false"
81+
ipv4:
82+
method: "auto"
83+
ipv6:
84+
method: "disabled"
85+
proxy: {}
86+
enp12s0f4u1u2c2:
87+
content:
88+
connection:
89+
id: "enp12s0f4u1u2c2"
90+
type: "ethernet"
91+
autoconnect: "false"
92+
interface-name: "enp12s0f4u1u2c2"
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"
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'merken01.cp.lsst.org', :sitepp do
6+
on_supported_os.each do |os, os_facts|
7+
next unless os =~ %r{almalinux-9-x86_64}
8+
9+
context "on #{os}" do
10+
let(:facts) do
11+
lsst_override_facts(os_facts,
12+
is_virtual: false,
13+
virtual: 'physical',
14+
dmi: {
15+
'product' => {
16+
'name' => 'AS -1115HS-TNR',
17+
},
18+
})
19+
end
20+
let(:node_params) do
21+
{
22+
role: 'rke2server',
23+
site: 'cp',
24+
cluster: 'merken',
25+
}
26+
end
27+
28+
it { is_expected.to compile.with_all_deps }
29+
30+
include_examples 'baremetal'
31+
include_context 'with nm interface'
32+
include_examples 'ceph cluster'
33+
34+
it do
35+
is_expected.to contain_class('clustershell').with(
36+
groupmembers: {
37+
'merken' => {
38+
'group' => 'merken',
39+
'member' => 'merken[01-04]',
40+
},
41+
}
42+
)
43+
end
44+
45+
it do
46+
is_expected.to contain_class('rke2').with(
47+
node_type: 'server',
48+
release_series: '1.32',
49+
version: '1.32.2~rke2r1'
50+
)
51+
end
52+
53+
it do
54+
expect(catalogue.resource('class', 'nm')[:conf]).to include(
55+
'device' => {
56+
'keep-configuration' => 'no',
57+
'allowed-connections' => 'except:origin:nm-initrd-generator',
58+
}
59+
)
60+
end
61+
62+
it { is_expected.to have_nm__connection_resource_count(6) }
63+
64+
%w[
65+
enp12s0f4u1u2c2
66+
].each do |i|
67+
context "with #{i}" do
68+
let(:interface) { i }
69+
70+
it_behaves_like 'nm disabled interface'
71+
end
72+
end
73+
74+
%w[
75+
enp65s0f0
76+
enp65s0f1
77+
].each do |i|
78+
context "with #{i}" do
79+
let(:interface) { i }
80+
81+
it_behaves_like 'nm named interface'
82+
it_behaves_like 'nm ethernet interface'
83+
it_behaves_like 'nm no-ip interface'
84+
it { expect(nm_keyfile['connection']['master']).to eq('bond0') }
85+
it { expect(nm_keyfile['connection']['slave-type']).to eq('bond') }
86+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
87+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv4\]$}) }
88+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv6\]$}) }
89+
end
90+
end
91+
92+
context 'with bond0' do
93+
let(:interface) { 'bond0' }
94+
95+
it_behaves_like 'nm named interface'
96+
it_behaves_like 'nm no-ip interface'
97+
it { expect(nm_keyfile['connection']['type']).to eq('bond') }
98+
it { expect(nm_keyfile['bond']['miimon']).to eq(100) }
99+
it { expect(nm_keyfile['bond']['mode']).to eq('802.3ad') }
100+
it { expect(nm_keyfile['bond']['xmit_hash_policy']).to eq('layer3+4') }
101+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
102+
it { expect(nm_keyfile_raw).not_to match(%r{^\[proxy\]$}) }
103+
end
104+
105+
%w[
106+
1131
107+
].each do |vlan|
108+
iface = "bond0.#{vlan}"
109+
110+
context "with #{iface}" do
111+
let(:interface) { iface }
112+
113+
it_behaves_like 'nm enabled interface'
114+
it_behaves_like 'nm vlan interface', id: vlan.to_i, parent: 'bond0'
115+
it_behaves_like 'nm bridge slave interface', master: "br#{vlan}"
116+
end
117+
end
118+
119+
context 'with br1131' do
120+
let(:interface) { 'br1131' }
121+
122+
it_behaves_like 'nm enabled interface'
123+
it_behaves_like 'nm bridge interface'
124+
it_behaves_like 'nm dhcp interface'
125+
end
126+
end # on os
127+
end # on_supported_os
128+
end

0 commit comments

Comments
 (0)