Skip to content

Commit 7babc21

Browse files
committed
move compute_init tasks to right place and document
1 parent 8bb90b4 commit 7babc21

File tree

5 files changed

+49
-160
lines changed

5 files changed

+49
-160
lines changed

ansible/extras.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
- import_role:
3838
name: persist_hostkeys
3939

40-
# TODO: I'm not convinced this is the right place
40+
# TODO: Is this is the right place?
4141
- hosts: compute_init:!builder
4242
tags: compute_init
4343
become: yes
@@ -47,17 +47,6 @@
4747
name: compute_init
4848
tasks_from: export.yml
4949

50-
# TODO: really this should only run during build
51-
# but handy not to for debugging without build
52-
- name: Install compute_init script
53-
hosts: compute_init
54-
tags: compute_init
55-
become: yes
56-
tasks:
57-
- include_role:
58-
name: compute_init
59-
tasks_from: install.yml
60-
6150
- name: Install k9s
6251
become: yes
6352
hosts: k9s

ansible/fatimage.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@
5555

5656
- import_playbook: extras.yml
5757

58+
# TODO: is this the right place?
59+
- name: Install compute_init script
60+
hosts: compute_init
61+
tags: compute_init # tagged to allow running on cluster instances for dev
62+
become: yes
63+
tasks:
64+
- include_role:
65+
name: compute_init
66+
tasks_from: install.yml
67+
5868
- hosts: builder
5969
become: yes
6070
gather_facts: yes

ansible/roles/compute_init/tasks/main.yml

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

docs/experimental/compute-init.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,47 @@
1+
# compute-init
2+
3+
TODO: describe current status.
4+
5+
# Development
16

27
To develop/debug this without actually having to build an image:
38

4-
On deploy host:
59

6-
.stackhpc/ (venv) [rocky@steveb-dev slurm-app-rl9]$ ansible-playbook ansible/extras.yml --tags compute_init
10+
1. Add the compute nodes into the `compute_init` group:
711

8-
On compute node:
12+
cat <<EOF >> $APPLIANCES_ENVIRONMENT_ROOT/inventory/extra_groups
13+
[compute_init:children]
14+
compute
15+
EOF
916

10-
[root@rl9-compute-0 rocky]# rm -f /var/lib/ansible-init.done && systemctl restart ansible-init
11-
[root@rl9-compute-0 rocky]# systemctl status ansible-init
17+
2. Deploy a cluster using tofu and ansible/site.yml as normal. This will
18+
additionally configure the control node to export compute hosts over NFS.
19+
Check the cluster is up.
20+
21+
3. Reimage the compute nodes:
22+
23+
ansible-playbook --limit compute ansible/adhoc/rebuild
24+
25+
4. Add metadata to a compute node e.g. via Horzon to turn on compute-init
26+
playbook functionality.
27+
28+
5. Fake an image build to deploy the compute-init playbook:
29+
30+
ansible-playbook ansible/fatimage.yml --tags compute_init
31+
32+
6. Fake a reimage of compute to run ansible-init and the compute-init playbook:
33+
34+
On compute node where metadata was added:
35+
36+
[root@rl9-compute-0 rocky]# rm -f /var/lib/ansible-init.done && systemctl restart ansible-init
37+
[root@rl9-compute-0 rocky]# systemctl status ansible-init
38+
39+
Use `systemctl status ansible-init` to view stdout/stderr from Ansible.
40+
41+
Steps 5/6 can be repeated with changes to the compute script. If desirable
42+
reimage the compute node(s) first as in step 3.
1243

44+
# Results/progress
1345

1446
Without any metadata:
1547

environments/common/inventory/group_vars/all/nfs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ nfs_configurations:
2020
nfs_enable:
2121
server: "{{ inventory_hostname in groups['control'] }}"
2222
clients: false
23-
nfs_export: "/exports/cluster" # control node has to copy in /etc/hosts to here
23+
nfs_export: "/exports/cluster"

0 commit comments

Comments
 (0)