Skip to content

Commit 8e1d0c0

Browse files
committed
Merge branch 'main' into feature/cacert
2 parents 4811c6a + 8b1c94c commit 8e1d0c0

File tree

7 files changed

+68
-4
lines changed

7 files changed

+68
-4
lines changed

ansible/roles/compute_init/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ it also requires an image build with the role name added to the
4646
| bootstrap.yml | (system users) | None required - use image build | No |
4747
| bootstrap.yml | systemd | None required - use image build | No |
4848
| bootstrap.yml | selinux | None required - use image build | Maybe [1] |
49-
| bootstrap.yml | sshd | None at present | No |
49+
| bootstrap.yml | sshd | Fully supported | No |
5050
| bootstrap.yml | dnf_repos | None at present [2] | - |
5151
| bootstrap.yml | cacerts | Supported [3] | - |
5252
| bootstrap.yml | squid | Not relevant for compute nodes | n/a |
@@ -64,7 +64,7 @@ it also requires an image build with the role name added to the
6464
| hooks/post-bootstrap.yml | ? | None at present | n/a |
6565
| iam.yml | freeipa_client | None at present [4] | Yes |
6666
| iam.yml | freeipa_server | Not relevant for compute nodes | n/a |
67-
| iam.yml | sssd | None at present | No |
67+
| iam.yml | sssd | Fully supported | No |
6868
| filesystems.yml | block_devices | None required - role deprecated | n/a |
6969
| filesystems.yml | nfs | All client functionality | No |
7070
| filesystems.yml | manila | All functionality | No [5] |

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
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+
<<<<<<< HEAD
1213
enable_cacerts: "{{ os_metadata.meta.cacerts | default(false) | bool }}"
14+
=======
15+
enable_sssd: "{{ os_metadata.meta.sssd | default(false) | bool }}"
16+
enable_sshd: "{{ os_metadata.meta.sshd | default(false) | bool }}"
17+
>>>>>>> main
1318
enable_tuned: "{{ os_metadata.meta.tuned | default(false) | bool }}"
1419
enable_nfs: "{{ os_metadata.meta.nfs | default(false) | bool }}"
1520
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
@@ -140,10 +145,25 @@
140145
cacerts_cert_dir: "/mnt/cluster/cacerts"
141146
when: enable_cacerts
142147

148+
- name: Configure sshd
149+
ansible.builtin.include_role:
150+
name: sshd
151+
vars:
152+
sshd_conf_src: "/mnt/cluster/hostconfig/{{ ansible_hostname }}/sshd.conf"
153+
when: enable_sshd
154+
143155
- name: Configure tuned
144156
include_tasks: tasks/tuned.yml
145157
when: enable_tuned
146158

159+
- name: Configure sssd
160+
ansible.builtin.include_role:
161+
name: sssd
162+
tasks_from: configure.yml
163+
vars:
164+
sssd_conf_src: "/mnt/cluster/hostconfig/{{ ansible_hostname }}/sssd.conf"
165+
when: enable_sssd
166+
147167
# NFS client mount
148168
- name: If nfs-clients is present
149169
include_tasks: tasks/nfs-clients.yml

ansible/roles/compute_init/tasks/export.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,24 @@
8484
delegate_to: "{{ groups['control'] | first }}"
8585
run_once: true
8686
when: "'cacerts' in group_names"
87+
88+
- name: Create hostconfig directory
89+
file:
90+
path: "/exports/cluster/hostconfig/{{ inventory_hostname }}/"
91+
state: directory
92+
owner: root
93+
group: root
94+
mode: u=rw,go=
95+
delegate_to: "{{ groups['control'] | first }}"
96+
97+
- name: Template sssd config
98+
import_role:
99+
name: sssd
100+
tasks_from: export.yml
101+
when: "'sssd' in group_names"
102+
103+
- name: Template sshd config
104+
import_role:
105+
name: sshd
106+
tasks_from: export.yml
107+
when: "'sshd' in group_names"

ansible/roles/compute_init/tasks/install.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
dest: filter_plugins/filter_keys.py
3636
- src: ../../cacerts
3737
dest: roles/
38+
- src: ../../sssd
39+
dest: roles/
40+
- src: ../../sshd
41+
dest: roles/
3842
- src: ../../tuned/tasks/configure.yml
3943
dest: tasks/tuned.yml
4044
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml

ansible/roles/sshd/tasks/export.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Exclusively used for compute-init
2+
- name: Inject host specific config template
3+
template:
4+
src: "{{ sshd_conf_src }}"
5+
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/sshd.conf"
6+
owner: root
7+
group: root
8+
mode: u=rw,go=
9+
delegate_to: "{{ groups['control'] | first }}"

ansible/roles/sssd/tasks/configure.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
- name: "Ensure oddjob is started"
3131
service:
3232
name: oddjobd
33-
state: "{{ sssd_enable_mkhomedir }}"
34-
enabled: "{{ sssd_enable_mkhomedir }}"
33+
state: 'started'
34+
enabled: true
35+
when: sssd_enable_mkhomedir | bool

ansible/roles/sssd/tasks/export.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Exclusively used for compute-init
2+
- name: Inject host specific config template
3+
template:
4+
src: "{{ sssd_conf_src }}"
5+
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/sssd.conf"
6+
owner: root
7+
group: root
8+
mode: u=rw,go=
9+
delegate_to: "{{ groups['control'] | first }}"

0 commit comments

Comments
 (0)