Skip to content

Commit 7767198

Browse files
authored
Merge pull request #96 from stackhpc/fix-hooks
Fix Ansible playbook paths
2 parents ab96985 + 14bf50e commit 7767198

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

ansible/deploy-openstack-config.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,32 @@
149149
- seed-host-configure/pre.d/
150150
- infra-vm-host-configure/pre.d/
151151

152+
- name: Check if custom playbooks are stored in separate directories
153+
ansible.builtin.stat:
154+
path: "{{ src_directory }}/{{ kayobe_config_name }}/etc/kayobe/ansible/fixes"
155+
register: kayobe_playbooks_dir
156+
157+
- name: Set custom playbook prefixes
158+
ansible.builtin.set_fact:
159+
fixes_prefix: "{{ fixes/ if kayobe_playbooks_dir.stat.exists else '' }}"
160+
tools_prefix: "{{ tools/ if kayobe_playbooks_dir.stat.exists else '' }}"
161+
152162
- name: Ensure Kayobe hooks are present
153163
ansible.builtin.file:
154164
src: '{{ src_directory }}/{{ kayobe_config_name }}/etc/kayobe/ansible/{{ item.src }}'
155165
dest: '{{ src_directory }}/{{ kayobe_config_name }}/etc/kayobe/hooks/{{ item.dest }}'
156166
state: link
157167
loop:
158-
- { src: growroot.yml, dest: overcloud-host-configure/pre.d/5-growroot.yml }
159-
- { src: fix-hostname.yml, dest: overcloud-host-configure/pre.d/10-fix-hostname.yml }
160-
- { src: fix-networking.yml, dest: overcloud-host-configure/pre.d/15-fix-networking.yml }
161-
- { src: configure-vxlan.yml, dest: overcloud-host-configure/pre.d/20-configure-vxlan.yml }
162-
- { src: growroot.yml, dest: seed-host-configure/pre.d/5-growroot.yml }
163-
- { src: fix-networking.yml, dest: seed-host-configure/pre.d/15-fix-networking.yml }
164-
- { src: configure-vxlan.yml, dest: seed-host-configure/pre.d/20-configure-vxlan.yml }
165-
- { src: growroot.yml, dest: infra-vm-host-configure/pre.d/5-growroot.yml }
166-
- { src: fix-networking.yml, dest: infra-vm-host-configure/pre.d/15-fix-networking.yml }
167-
- { src: configure-vxlan.yml, dest: infra-vm-host-configure/pre.d/20-configure-vxlan.yml }
168+
- { src: "{{ tools_prefix }}growroot.yml", dest: overcloud-host-configure/pre.d/5-growroot.yml }
169+
- { src: "{{ fixes_prefix }}fix-hostname.yml", dest: overcloud-host-configure/pre.d/10-fix-hostname.yml }
170+
- { src: "{{ fixes_prefix }}fix-networking.yml", dest: overcloud-host-configure/pre.d/15-fix-networking.yml }
171+
- { src: "{{ tools_prefix }}configure-vxlan.yml", dest: overcloud-host-configure/pre.d/20-configure-vxlan.yml }
172+
- { src: "{{ tools_prefix }}growroot.yml", dest: seed-host-configure/pre.d/5-growroot.yml }
173+
- { src: "{{ fixes_prefix }}fix-networking.yml", dest: seed-host-configure/pre.d/15-fix-networking.yml }
174+
- { src: "{{ tools_prefix }}configure-vxlan.yml", dest: seed-host-configure/pre.d/20-configure-vxlan.yml }
175+
- { src: "{{ tools_prefix }}growroot.yml", dest: infra-vm-host-configure/pre.d/5-growroot.yml }
176+
- { src: "{{ fixes_prefix }}fix-networking.yml", dest: infra-vm-host-configure/pre.d/15-fix-networking.yml }
177+
- { src: "{{ tools_prefix }}configure-vxlan.yml", dest: infra-vm-host-configure/pre.d/20-configure-vxlan.yml }
168178

169179
- name: Ensure Admin Overcloud Network file is present
170180
ansible.builtin.copy:

0 commit comments

Comments
 (0)