Skip to content

Commit 8e6ea8d

Browse files
igonzalezclgseriche
authored andcommitted
(merken) Provision Cluster
1 parent 6184abb commit 8e6ea8d

File tree

3 files changed

+269
-0
lines changed

3 files changed

+269
-0
lines changed

hieradata/cluster/merken.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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: "8e402e97-89f5-40e0-b0d1-52bbe0ea1496"
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: "bc796d5f-c928-4265-8fe3-7d1bf34c3015"
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+
bond0.1130:
72+
content:
73+
connection:
74+
id: "bond0.1130"
75+
uuid: "16f1ff81-ea90-4d99-a4db-30f2acd1c810"
76+
type: "vlan"
77+
interface-name: "bond0.1130"
78+
master: "br1130"
79+
slave-type: "bridge"
80+
ethernet: {}
81+
vlan:
82+
flags: "1"
83+
id: "1130"
84+
parent: "bond0"
85+
bridge-port: {}
86+
br1131:
87+
content:
88+
connection:
89+
id: "br1131"
90+
uuid: "b5c7a6ef-b449-4729-b944-ec45c40b40cc"
91+
type: "bridge"
92+
interface-name: "br1131"
93+
ethernet: {}
94+
bridge:
95+
stp: "false"
96+
ipv4:
97+
method: "auto"
98+
ipv6:
99+
method: "disabled"
100+
proxy: {}
101+
br1130:
102+
content:
103+
connection:
104+
id: "br1130"
105+
uuid: "975148dc-d5d3-46d9-97f2-66a41041bbd5"
106+
type: "bridge"
107+
interface-name: "br1130"
108+
ethernet: {}
109+
bridge:
110+
stp: "false"
111+
ipv4:
112+
method: "disabled"
113+
ipv6:
114+
method: "disabled"
115+
proxy: {}
116+
enp12s0f4u1u2c2:
117+
content:
118+
connection:
119+
id: "enp12s0f4u1u2c2"
120+
type: "ethernet"
121+
autoconnect: "false"
122+
interface-name: "enp12s0f4u1u2c2"
123+
ethernet: {}
124+
ipv4:
125+
method: "disabled"
126+
ipv6:
127+
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: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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 { is_expected.to contain_class('tuned').with_active_profile('latency-performance') }
35+
36+
it do
37+
is_expected.to contain_class('clustershell').with(
38+
groupmembers: {
39+
'merken' => {
40+
'group' => 'merken',
41+
'member' => 'merken[01-04]',
42+
},
43+
}
44+
)
45+
end
46+
47+
it do
48+
is_expected.to contain_class('rke2').with(
49+
node_type: 'server',
50+
release_series: '1.32',
51+
version: '1.32.2~rke2r1'
52+
)
53+
end
54+
55+
it do
56+
# Ensure the storage role label is applied to the RKE2 server node
57+
expect(catalogue.resource('class', 'rke2')[:config]['node-label']).to include('role=storage-node')
58+
end
59+
60+
it do
61+
expect(catalogue.resource('class', 'nm')[:conf]).to include(
62+
'device' => {
63+
'keep-configuration' => 'no',
64+
'allowed-connections' => 'except:origin:nm-initrd-generator',
65+
}
66+
)
67+
end
68+
69+
it { is_expected.to have_nm__connection_resource_count(8) }
70+
71+
%w[
72+
enp12s0f4u1u2c2
73+
].each do |i|
74+
context "with #{i}" do
75+
let(:interface) { i }
76+
77+
it_behaves_like 'nm disabled interface'
78+
end
79+
end
80+
81+
%w[
82+
enp65s0f0
83+
enp65s0f1
84+
].each do |i|
85+
context "with #{i}" do
86+
let(:interface) { i }
87+
88+
it_behaves_like 'nm named interface'
89+
it_behaves_like 'nm ethernet interface'
90+
it_behaves_like 'nm no-ip interface'
91+
it { expect(nm_keyfile['connection']['master']).to eq('bond0') }
92+
it { expect(nm_keyfile['connection']['slave-type']).to eq('bond') }
93+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
94+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv4\]$}) }
95+
it { expect(nm_keyfile_raw).to match(%r{^\[ipv6\]$}) }
96+
end
97+
end
98+
99+
context 'with bond0' do
100+
let(:interface) { 'bond0' }
101+
102+
it_behaves_like 'nm named interface'
103+
it_behaves_like 'nm no-ip interface'
104+
it { expect(nm_keyfile['connection']['type']).to eq('bond') }
105+
it { expect(nm_keyfile['bond']['miimon']).to eq(100) }
106+
it { expect(nm_keyfile['bond']['mode']).to eq('802.3ad') }
107+
it { expect(nm_keyfile['bond']['xmit_hash_policy']).to eq('layer3+4') }
108+
it { expect(nm_keyfile_raw).to match(%r{^\[ethernet\]$}) }
109+
it { expect(nm_keyfile_raw).not_to match(%r{^\[proxy\]$}) }
110+
end
111+
112+
%w[
113+
1131
114+
].each do |vlan|
115+
iface = "bond0.#{vlan}"
116+
117+
context "with #{iface}" do
118+
let(:interface) { iface }
119+
120+
it_behaves_like 'nm enabled interface'
121+
it_behaves_like 'nm vlan interface', id: vlan.to_i, parent: 'bond0'
122+
it_behaves_like 'nm bridge slave interface', master: "br#{vlan}"
123+
end
124+
end
125+
126+
context 'with br1131' do
127+
let(:interface) { 'br1131' }
128+
129+
it_behaves_like 'nm enabled interface'
130+
it_behaves_like 'nm bridge interface'
131+
it_behaves_like 'nm dhcp interface'
132+
end
133+
end # on os
134+
end # on_supported_os
135+
end

0 commit comments

Comments
 (0)