Skip to content

Commit 9c29df9

Browse files
committed
fix export.yml for inactive configs
1 parent 0152960 commit 9c29df9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

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

Lines changed: 6 additions & 2 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_sssd: "{{ os_metadata.meta.sssd | 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 }}"
@@ -140,9 +141,12 @@
140141
- name: Configure sssd
141142
block:
142143
- name: Manage sssd.conf configuration
143-
copy:
144-
src: "/exports/cluster/hostconfig/{{ ansible_hostname }}/sssd.conf"
144+
ansible.builtin.template:
145+
src: "/mnt/cluster/hostconfig/{{ ansible_hostname }}/sssd.conf.j2"
145146
dest: "{{ sssd_conf_dest }}"
147+
owner: root
148+
group: root
149+
mode: "0600"
146150

147151
- name: Restart sssd
148152
systemd:

ansible/roles/compute_init/tasks/export.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,17 @@
8282
delegate_to: "{{ groups['control'] | first }}"
8383

8484
- name: Inject host specific config template files
85-
template:
85+
copy:
8686
src: "{{ item.src }}"
8787
dest: "/exports/cluster/hostconfig/{{ inventory_hostname }}/{{ item.dest }}"
8888
owner: root
8989
group: root
9090
mode: u=rw,go=
9191
loop:
92-
- src: "{{ sssd_conf_src }}"
93-
dest: sssd.conf
94-
- src: "{{ sshd_conf_src }}"
95-
dest: sshd.conf
96-
delegate_to: "{{ groups['control'] | first }}"
92+
- src: "{{ sssd_conf_src | default('') }}"
93+
dest: sssd.conf.j2
94+
- src: "{{ sshd_conf_src | default('') }}"
95+
dest: sshd.conf.j2
96+
when:
97+
- item.src != ''
98+
delegate_to: "{{ groups['control'] | first }}"

0 commit comments

Comments
 (0)