Skip to content
Open
6 changes: 3 additions & 3 deletions ansible/roles/cacerts/tasks/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
ansible.builtin.copy:
src: "{{ item }}"
dest: /exports/cluster/cacerts/
owner: slurm
group: root
mode: "0644"
owner: ansible-init
group: ansible-init
mode: u=rw,go=
with_fileglob:
- "{{ cacerts_cert_dir }}/*"
delegate_to: "{{ groups['control'] | first }}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/compute_init/files/compute-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
- ansible.builtin.meta: end_play
- name: Check if hostvars exist
become: true
become_user: slurm
become_user: ansible-init # share is root-squashed
ansible.builtin.stat:
path: "/mnt/cluster/hostvars/{{ ansible_hostname }}/hostvars.yml"
register: hostvars_stat
Expand All @@ -98,7 +98,7 @@
- ansible.builtin.meta: end_play
- name: Sync /mnt/cluster to /var/tmp
become: true
become_user: slurm
become_user: ansible-init # share is root-squashed
ansible.posix.synchronize:
src: "/mnt/cluster/"
dest: "/var/tmp/cluster/"
Expand Down
50 changes: 23 additions & 27 deletions ansible/roles/compute_init/tasks/export.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
---
- name: Ensure the /exports/cluster directory exists
- name: Ensure /exports/cluster directory structure exists
ansible.builtin.file:
path: /exports/cluster
state: directory
owner: slurm
group: root
owner: ansible-init
group: ansible-init
mode: u=rX,g=rwX,o=
run_once: true
loop:
- /exports/cluster
- /exports/cluster/hostvars
- /exports/cluster/cacerts
- /exports/cluster/cvmfs
- /exports/cluster/hostconfig
delegate_to: "{{ groups['control'] | first }}"

- name: Copy /etc/hosts to /exports/cluster
ansible.builtin.copy:
src: /etc/hosts
dest: /exports/cluster/hosts
owner: slurm
group: root
mode: u=r,g=rw,o=
owner: ansible-init
group: ansible-init
mode: u=rw,go=r
remote_src: true
run_once: true
delegate_to: "{{ groups['control'] | first }}"

- name: Create hostvars directory
- name: Create per-host hostvars directory
ansible.builtin.file:
path: /exports/cluster/hostvars/{{ inventory_hostname }}/
state: directory
owner: slurm
group: root
mode: u=rX,g=rwX,o=
owner: ansible-init
group: ansible-init
mode: u=rwX,go=
delegate_to: "{{ groups['control'] | first }}"

- name: Template out hostvars
ansible.builtin.template:
src: hostvars.yml.j2
dest: /exports/cluster/hostvars/{{ inventory_hostname }}/hostvars.yml
owner: slurm
group: root
mode: u=r,g=rw,o=
owner: ansible-init
group: ansible-init
mode: u=rw,go=
delegate_to: "{{ groups['control'] | first }}"

- name: Copy manila share info to /exports/cluster
Expand All @@ -52,29 +58,19 @@
os_manila_mount_share_info_var:
os_manila_mount_share_info: "{{ os_manila_mount_share_info }}"

- name: Ensure /exports/cluster/cvmfs directory exists
ansible.builtin.file:
path: /exports/cluster/cvmfs
state: directory
owner: slurm
group: root
mode: "0755"
run_once: true
delegate_to: "{{ groups['control'] | first }}"

- name: Export cacerts
ansible.builtin.include_role:
name: cacerts
tasks_from: export.yml
when: "'cacerts' in group_names"

- name: Create hostconfig directory
- name: Create per-host hostconfig directory
ansible.builtin.file:
path: "/exports/cluster/hostconfig/{{ inventory_hostname }}/"
state: directory
owner: slurm
group: root
mode: u=rX,g=rwX,o=
owner: ansible-init
group: ansible-init
mode: u=rwX,go=
delegate_to: "{{ groups['control'] | first }}"

- name: Template sssd config
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/nhc/tasks/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
ansible.builtin.template:
src: "{{ nhc_config_template }}"
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/nhc.conf"
mode: "0644"
owner: ansible-init
group: ansible-init
mode: u=rw,go=
delegate_to: "{{ groups['control'] | first }}"
4 changes: 2 additions & 2 deletions ansible/roles/sssd/tasks/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ansible.builtin.template:
src: "{{ sssd_conf_src }}"
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/sssd.conf"
owner: root
group: root
owner: ansible-init
group: ansible-init
mode: u=rw,go=
delegate_to: "{{ groups['control'] | first }}"
4 changes: 2 additions & 2 deletions environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cluster_image": {
"RL8": "openhpc-RL8-251211-0951-51b93e3f",
"RL9": "openhpc-RL9-251211-0951-51b93e3f"
"RL8": "openhpc-RL8-251213-1133-31273766",
"RL9": "openhpc-RL9-251213-1133-31273766"
}
}
10 changes: 10 additions & 0 deletions environments/common/inventory/group_vars/all/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ appliances_local_users_default:
system: true
enable: "{{ 'grafana' in group_names }}"

- user:
name: ansible-init
comment: ansible-init user
uid: 301
create_home: false
home: /var/lib/ansible-init
shell: /sbin/nologin
system: true
enable: "{{ 'ansible_init' in group_names }}"

# Overide this to add extra users whilst keeping the defaults.
appliances_local_users_extra: [] # see format of appliances_local_users_default above
appliances_local_users: "{{ (appliances_local_users_default + appliances_local_users_extra) | select | list }}"
Expand Down
1 change: 1 addition & 0 deletions environments/common/inventory/group_vars/all/nfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ nfs_configuration_compute_nodes: # cluster configuration for compute_init/slurm-
server: "{{ inventory_hostname in groups['control'] }}"
clients: false
nfs_export: "/exports/cluster"
nfs_export_options: "ro,secure,root_squash"

nfs_configurations_extra: [] # site-specific nfs shares

Expand Down
Loading