Skip to content

Commit 6d37646

Browse files
authored
fix: update host setup so that it will respect different inv files (#683)
The host setup playbook anchored on all, and then made specific tasks execute on special group names. This change simply updates the inital playbook so that it can run on any invntory and will execute post tasks when special variables are defined. Signed-off-by: Kevin Carter <[email protected]>
1 parent aea87fc commit 6d37646

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

ansible/playbooks/host-setup.yml

+9-22
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,11 @@
3636

3737
- hosts: all
3838
become: true
39-
gather_facts: "{{ gather_facts | default(true) }}"
39+
gather_facts: true
4040
environment: "{{ deployment_environment_variables | default({}) }}"
4141
roles:
4242
- host_setup
43-
44-
- hosts: openstack_compute_nodes
45-
become: true
46-
gather_facts: true
47-
environment: "{{ deployment_environment_variables | default({}) }}"
48-
tasks:
43+
post_tasks:
4944
- name: Copy over multipath Round Robin configuration file
5045
when:
5146
- custom_multipath | default(false) | bool
@@ -59,21 +54,6 @@
5954
mode: '0644'
6055
notify:
6156
- Restart multipathd systemd service
62-
handlers:
63-
- name: Restart multipathd systemd service
64-
ansible.builtin.systemd:
65-
name: multipathd
66-
state: restarted
67-
daemon_reload: true
68-
enabled: true
69-
70-
71-
72-
- hosts: openstack_compute_nodes
73-
become: true
74-
gather_facts: true
75-
environment: "{{ deployment_environment_variables | default({}) }}"
76-
tasks:
7757
- name: Install open-iscsi and multipath on nova compute nodes
7858
when:
7959
- enable_iscsi | default(false) | bool
@@ -96,3 +76,10 @@
9676
name: multipathd.service
9777
state: "{{ (_multipath_packages is changed) | ternary('restarted', 'started') }}"
9878
enabled: true
79+
handlers:
80+
- name: Restart multipathd systemd service
81+
ansible.builtin.systemd:
82+
name: multipathd
83+
state: restarted
84+
daemon_reload: true
85+
enabled: true

0 commit comments

Comments
 (0)