Skip to content

Commit 64c69dc

Browse files
Merge pull request #660 from akrzos/sno_nvme_for_etcd
Enable Etcd on NVMe for SNOs and converge controlplane and sno igniti…
2 parents 695a13a + f4e1f73 commit 64c69dc

File tree

6 files changed

+25
-92
lines changed

6 files changed

+25
-92
lines changed

ansible/roles/configure-local-storage/defaults/main.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
22
# configure-local-storage default vars
33

4-
sno_localstorage_configuration: false
5-
sno_localstorage_device: /dev/nvme0n1
6-
sno_localstorage_lv_count: 10
7-
sno_localstorage_lv_size: 100G
8-
4+
# controlplane_* configures local storage on SNO, 3-Node Compact MNO, and
5+
# Control-plane nodes on a "standard" multi-node deployment with workers
96
controlplane_etcd_on_nvme: false
107
controlplane_nvme_device: /dev/nvme0n1
118
controlplane_localstorage_configuration: false
129
controlplane_localstorage_device: /dev/sdb
1310
controlplane_localstorage_lv_count: 10
1411
controlplane_localstorage_lv_size: 100G
1512

13+
# worker_* configures local storage on worker nodes on a "standard"
14+
# multi-node deployment with workers
1615
worker_localstorage_configuration: false
1716
worker_localstorage_device: /dev/nvme0n1
1817
worker_localstorage_lv_count: 10

ansible/roles/configure-local-storage/tasks/main.yml

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,27 @@
1010
return_content: true
1111
register: get_hosts
1212

13-
- name: Multi Node storage configuration
14-
block:
15-
- name: Apply controlplane host ignition config overrides
16-
uri:
17-
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}/hosts/{{ item.id }}/ignition"
18-
method: PATCH
19-
body_format: json
20-
status_code: [201]
21-
return_content: true
22-
body: { "config": "{{ lookup('template', 'controlplane.ign.j2') | to_json }}" }
23-
with_items: "{{ get_hosts.json|selectattr('role', 'eq', 'master') | list }}"
24-
when: (controlplane_etcd_on_nvme or controlplane_localstorage_configuration)
25-
26-
- name: Apply worker host ignition config overrides
27-
uri:
28-
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}/hosts//{{ item.id }}/ignition"
29-
method: PATCH
30-
body_format: json
31-
status_code: [201]
32-
return_content: true
33-
body: { "config": "{{ lookup('template', 'worker.ign.j2') | to_json }}" }
34-
with_items: "{{ get_hosts.json|selectattr('role', 'eq', 'worker') | list }}"
35-
when: worker_localstorage_configuration
36-
when: cluster_type != "sno"
13+
# Applies both SNO and MNO control-plane Etcd on NVME and/or localstorage configuration
14+
- name: Apply controlplane host ignition config overrides
15+
uri:
16+
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}/hosts/{{ item.id }}/ignition"
17+
method: PATCH
18+
body_format: json
19+
status_code: [201]
20+
return_content: true
21+
body: { "config": "{{ lookup('template', 'controlplane.ign.j2') | to_json }}" }
22+
with_items: "{{ get_hosts.json|selectattr('role', 'eq', 'master') | list }}"
23+
when: (controlplane_etcd_on_nvme or controlplane_localstorage_configuration)
3724

38-
- name: Apply sno host ignition config overrides
25+
- name: Apply worker host ignition config overrides
3926
uri:
40-
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}/hosts/{{ get_hosts.json[0].id }}/ignition"
27+
url: "http://{{ assisted_installer_host }}:{{ assisted_installer_port }}/api/assisted-install/v2/infra-envs/{{ ai_infraenv_id }}/hosts//{{ item.id }}/ignition"
4128
method: PATCH
4229
body_format: json
4330
status_code: [201]
4431
return_content: true
45-
body: { "config": "{{ lookup('template', 'sno.ign.j2') | to_json }}" }
46-
when: cluster_type == "sno" and sno_localstorage_configuration
32+
body: { "config": "{{ lookup('template', 'worker.ign.j2') | to_json }}" }
33+
with_items: "{{ get_hosts.json|selectattr('role', 'eq', 'worker') | list }}"
34+
when:
35+
- worker_localstorage_configuration
36+
- cluster_type != "sno"

ansible/roles/configure-local-storage/templates/sno-setup-lvm.sh.j2

Lines changed: 0 additions & 14 deletions
This file was deleted.

ansible/roles/configure-local-storage/templates/sno.ign.j2

Lines changed: 0 additions & 42 deletions
This file was deleted.

ansible/roles/sno-post-cluster-install/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
when: setup_openshift_gitops
101101

102102
- name: Setup nodes localstorage
103-
when: sno_localstorage_configuration
103+
when: controlplane_localstorage_configuration
104104
block:
105105
- name: Install local-storage operator
106106
shell:

ansible/roles/sno-post-cluster-install/templates/localvolume.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ spec:
1010
volumeMode: Filesystem
1111
fsType: xfs
1212
devicePaths:
13-
{% for i in range(sno_localstorage_lv_count) %}
14-
- "/dev/vg_ls/lv_sno_tv{{ '%02d' % i }}"
13+
{% for i in range(controlplane_localstorage_lv_count) %}
14+
- "/dev/vg_ls/lv_cp_tv{{ '%02d' % i }}"
1515
{% endfor %}

0 commit comments

Comments
 (0)