Skip to content

Commit d944039

Browse files
committed
complete cacerts, with compute-init support
1 parent a3a6b98 commit d944039

File tree

12 files changed

+53
-32
lines changed

12 files changed

+53
-32
lines changed

ansible/bootstrap.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
- appliances_mode == 'configure'
131131
- not (dnf_repos_allow_insecure_creds | default(false)) # useful for development
132132

133-
- hosts: cacerts
133+
- hosts: cacerts:!builder
134134
tags: cacerts
135135
gather_facts: false
136136
tasks:

ansible/roles/cacerts/tasks/runtime.yml renamed to ansible/roles/cacerts/tasks/configure.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
- name: Copy all certificates
44
copy:
55
src: "{{ item }}"
6-
dest: /etc/pki/ca-trust/source/anchors
6+
dest: /etc/pki/ca-trust/source/anchors/
77
owner: root
8+
group: root
89
mode: 0644
910
with_fileglob:
10-
- "{{ appliances_environment_root }}/cacerts"
11+
- "{{ cacerts_cert_dir }}/*"
1112
become: true
1213

1314
- name: Update trust store
1415
command: update-ca-trust extract
15-
become: true
16+
become: true

ansible/roles/cacerts/tasks/install.yml

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

ansible/roles/cacerts/tasks/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
- import_tasks: install.yml
2-
- import_tasks: runtime.yml
1+
- import_tasks: configure.yml

ansible/roles/cacerts/tasks/validate.yml

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

ansible/roles/compute_init/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ it also requires an image build with the role name added to the
4848
| bootstrap.yml | selinux | None required - use image build | Maybe [1] |
4949
| bootstrap.yml | sshd | None at present | No |
5050
| bootstrap.yml | dnf_repos | None at present [2] | - |
51+
| bootstrap.yml | cacerts | Supported [3] | - |
5152
| bootstrap.yml | squid | Not relevant for compute nodes | n/a |
5253
| bootstrap.yml | tuned | Fully supported | No |
5354
| bootstrap.yml | freeipa_server | Not relevant for compute nodes | n/a |
@@ -61,23 +62,23 @@ it also requires an image build with the role name added to the
6162
| bootstrap.yml | ansible_init (install) | Not relevant during boot | n/a |
6263
| bootstrap.yml | k3s (install) | Not relevant during boot | n/a |
6364
| hooks/post-bootstrap.yml | ? | None at present | n/a |
64-
| iam.yml | freeipa_client | None at present [3] | Yes |
65+
| iam.yml | freeipa_client | None at present [4] | Yes |
6566
| iam.yml | freeipa_server | Not relevant for compute nodes | n/a |
6667
| iam.yml | sssd | None at present | No |
6768
| filesystems.yml | block_devices | None required - role deprecated | n/a |
6869
| filesystems.yml | nfs | All client functionality | No |
69-
| filesystems.yml | manila | All functionality | No [4] |
70+
| filesystems.yml | manila | All functionality | No [5] |
7071
| filesystems.yml | lustre | None at present | Yes |
71-
| extras.yml | basic_users | All functionality [5] | No |
72-
| extras.yml | eessi | All functionality [6] | No |
73-
| extras.yml | cuda | None required - use image build | Yes [7] |
72+
| extras.yml | basic_users | All functionality [6] | No |
73+
| extras.yml | eessi | All functionality [7] | No |
74+
| extras.yml | cuda | None required - use image build | Yes [8] |
7475
| extras.yml | persist_hostkeys | Not relevant for compute nodes | n/a |
7576
| extras.yml | compute_init (export) | Not relevant for compute nodes | n/a |
7677
| extras.yml | k9s (install) | Not relevant during boot | n/a |
77-
| extras.yml | extra_packages | None at present [8] | - |
78+
| extras.yml | extra_packages | None at present [9] | - |
7879
| slurm.yml | mysql | Not relevant for compute nodes | n/a |
7980
| slurm.yml | rebuild | Not relevant for compute nodes | n/a |
80-
| slurm.yml | openhpc [9] | All slurmd functionality | No |
81+
| slurm.yml | openhpc [10] | All slurmd functionality | No |
8182
| slurm.yml | (set memory limits) | None at present | - |
8283
| slurm.yml | (block ssh) | None at present | - |
8384
| portal.yml | (openondemand server) | Not relevant for compute nodes | n/a |
@@ -92,16 +93,17 @@ it also requires an image build with the role name added to the
9293
Notes:
9394
1. `selinux` is set to disabled in StackHPC images.
9495
2. Requirement for this functionality is TBD.
95-
3. FreeIPA client functionality would be better provided using a client fork
96+
3. `cacerts_cert_dir` must be the same on all nodes.
97+
4. FreeIPA client functionality would be better provided using a client fork
9698
which uses pkinit keys rather than OTP to reenrol nodes.
97-
4. Assuming default Ceph client version.
98-
5. Assumes home directory already exists on shared storage.
99-
6. Assumes `cvmfs_config` is the same on control node and all compute nodes.
100-
7. If `cuda` role was run during build, the nvidia-persistenced is enabled
99+
5. Assuming default Ceph client version.
100+
6. Assumes home directory already exists on shared storage.
101+
7. Assumes `cvmfs_config` is the same on control node and all compute nodes.
102+
8. If `cuda` role was run during build, the nvidia-persistenced is enabled
101103
and will start during boot.
102-
8. Would require `dnf_repos`.
103-
9. `openhpc` does not need to be added to `compute_init_enable`, this is
104-
automatically enabled by adding `compute`.
104+
9. Would require `dnf_repos`.
105+
10. `openhpc` does not need to be added to `compute_init_enable`, this is
106+
automatically enabled by adding `compute`.
105107

106108
## Approach
107109
This works as follows:

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
enable_compute: "{{ os_metadata.meta.compute | default(false) | bool }}"
1010
enable_resolv_conf: "{{ os_metadata.meta.resolv_conf | default(false) | bool }}"
1111
enable_etc_hosts: "{{ os_metadata.meta.etc_hosts | default(false) | bool }}"
12+
enable_cacerts: "{{ os_metadata.meta.cacerts | default(false) | bool }}"
1213
enable_tuned: "{{ os_metadata.meta.tuned | default(false) | bool }}"
1314
enable_nfs: "{{ os_metadata.meta.nfs | default(false) | bool }}"
1415
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
@@ -18,6 +19,8 @@
1819
# TODO: "= role defaults" - could be moved to a vars_file: on play with similar precedence effects
1920
resolv_conf_nameservers: []
2021

22+
cacerts_cert_dir: "/mnt/cluster/cacerts"
23+
2124
tuned_profile_baremetal: hpc-compute
2225
tuned_profile_vm: virtual-guest
2326
tuned_profile: "{{ tuned_profile_baremetal if ansible_virtualization_role != 'guest' else tuned_profile_vm }}"
@@ -132,6 +135,10 @@
132135
mode: 0644
133136
when: enable_etc_hosts
134137

138+
- name: Configure cacerts
139+
include_tasks: tasks/cacerts.yml
140+
when: enable_cacerts
141+
135142
- name: Configure tuned
136143
include_tasks: tasks/tuned.yml
137144
when: enable_tuned

ansible/roles/compute_init/tasks/export.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,16 @@
7171
remote_src: true
7272
run_once: true
7373
delegate_to: "{{ groups['control'] | first }}"
74+
75+
- name: Copy cacerts from deploy host to /exports/cluster/cacerts/
76+
copy:
77+
src: "{{ item }}"
78+
dest: /exports/cluster/cacerts/
79+
owner: root
80+
group: root
81+
mode: 0644
82+
with_fileglob:
83+
- "{{ cacerts_cert_dir | default(appliances_environment_root + '/cacerts') }}/*" # role default
84+
delegate_to: "{{ groups['control'] | first }}"
85+
run_once: true
86+
when: "'cacerts' in group_names"

ansible/roles/compute_init/tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
dest: files/NetworkManager-dns-none.conf
3333
- src: ../../basic_users/filter_plugins/filter_keys.py
3434
dest: filter_plugins/filter_keys.py
35+
- src: ../../cacerts/tasks/configure.yml
36+
dest: tasks/cacerts.yml
3537
- src: ../../tuned/tasks/configure.yml
3638
dest: tasks/tuned.yml
3739
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml

environments/.stackhpc/hooks/pre.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
tasks:
55
- name: Output OS version
66
command: cat /etc/redhat-release
7+
changed_when: false
8+
79
- name: Write CI-generated inventory and secrets for debugging
810
ansible.builtin.copy:
911
dest: /etc/ci-config/

environments/common/inventory/groups

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,6 @@ extra_packages
165165

166166
[pulp]
167167
# Add builder to this group to enable automatically syncing of pulp during image build
168+
169+
[cacerts]
170+
# Hosts to configure CA certificates and trusts on

environments/common/layouts/everything

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,6 @@ control
111111
[extra_packages:children]
112112
# Hosts to install specified additional packages on
113113
builder
114+
115+
[cacerts]
116+
# Hosts to configure CA certificates and trusts on

0 commit comments

Comments
 (0)