Skip to content

Commit 5f05c09

Browse files
committed
Move health check script deploy
Minor updates are broken due to the fact that health check scripts are deployed in install.yml task lists while the update role is using run.yml task lists Resolves: OSPRH-12088
1 parent ef239bb commit 5f05c09

File tree

15 files changed

+169
-70
lines changed

15 files changed

+169
-70
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
- name: Gather user fact
4+
ansible.builtin.setup:
5+
gather_subset:
6+
- "!all"
7+
- "!min"
8+
- "user"
9+
when:
10+
- ansible_user is undefined
11+
12+
- name: Ensure base directory for health checks exists
13+
become: true
14+
ansible.builtin.file:
15+
path: /var/lib/openstack/healthchecks
16+
state: directory
17+
setype: container_file_t
18+
owner: "{{ ansible_user | default(ansible_user_id) }}"
19+
group: "{{ ansible_user | default(ansible_user_id) }}"
20+
mode: '0755'
21+
22+
- name: Deploy iscsi health check script
23+
become: true
24+
ansible.builtin.copy:
25+
src: healthchecks/iscsid/
26+
dest: "/var/lib/openstack/healthchecks/iscsid"
27+
setype: container_file_t
28+
owner: "{{ ansible_user | default(ansible_user_id) }}"
29+
group: "{{ ansible_user | default(ansible_user_id) }}"
30+
mode: '0700'

roles/edpm_iscsid/tasks/install.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
- {'path': /var/lib/iscsi, 'setype': container_file_t}
3131
- {'path': /var/lib/config-data, 'setype': container_file_t, 'selevel': s0, 'mode': '0755'}
3232
- {'path': /var/lib/config-data/ansible-generated/iscsid, 'setype': container_file_t, 'mode': '0755'}
33-
- {'path': /var/lib/openstack/healthchecks, 'setype': container_file_t, 'mode': '0755'}
3433

3534
- name: Stat /lib/systemd/system/iscsid.socket
3635
ansible.builtin.stat:
@@ -56,12 +55,3 @@
5655
- ansible_facts.services["iscsi.service"] is defined
5756
- ansible_facts.services["iscsi.service"]["status"] != "not-found"
5857
- ansible_facts.services["iscsi.service"]["status"] == "enabled"
59-
60-
- name: Deploy iscsi health check script
61-
ansible.builtin.copy:
62-
src: healthchecks/iscsid/
63-
dest: "/var/lib/openstack/healthchecks/iscsid"
64-
setype: container_file_t
65-
owner: "{{ ansible_user | default(ansible_user_id) }}"
66-
group: "{{ ansible_user | default(ansible_user_id) }}"
67-
mode: '0700'

roles/edpm_iscsid/tasks/run.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
name: edpm_container_manage
2020
tasks_from: shutdown.yml
2121

22+
- name: Update iscsi health check script
23+
ansible.builtin.include_tasks:
24+
file: healthchecks.yml
25+
2226
- name: Manage iscsid containers
2327
ansible.builtin.include_role:
2428
name: edpm_container_standalone
@@ -52,7 +56,6 @@
5256
state: restarted
5357

5458
- name: Remove iscsid container restart sentinel file
55-
become: true
5659
ansible.builtin.file:
5760
path: /etc/iscsi/.iscsid_restart_required
5861
state: absent
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
- name: Gather user fact
4+
ansible.builtin.setup:
5+
gather_subset:
6+
- "!all"
7+
- "!min"
8+
- "user"
9+
when:
10+
- ansible_user is undefined
11+
12+
- name: Ensure base directory for health checks exists
13+
become: true
14+
ansible.builtin.file:
15+
path: /var/lib/openstack/healthchecks
16+
state: directory
17+
setype: container_file_t
18+
owner: "{{ ansible_user | default(ansible_user_id) }}"
19+
group: "{{ ansible_user | default(ansible_user_id) }}"
20+
mode: '0755'
21+
22+
- name: Deploy logrotate_crond health check script
23+
become: true
24+
ansible.builtin.copy:
25+
src: healthchecks/logrotate_crond/
26+
dest: /var/lib/openstack/healthchecks/logrotate_crond
27+
setype: container_file_t
28+
owner: "{{ ansible_user | default(ansible_user_id) }}"
29+
group: "{{ ansible_user | default(ansible_user_id) }}"
30+
mode: '0700'

roles/edpm_logrotate_crond/tasks/install.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,3 @@
5353
- ansible_facts.selinux is defined
5454
- ansible_facts.selinux.status == "enabled"
5555

56-
- name: Create a directory for container health checks
57-
ansible.builtin.file:
58-
path: /var/lib/openstack/healthchecks
59-
state: directory
60-
setype: container_file_t
61-
owner: "{{ ansible_user | default(ansible_user_id) }}"
62-
group: "{{ ansible_user | default(ansible_user_id) }}"
63-
mode: '0755'
64-
become: true
65-
66-
- name: Deploy logrotate_crond health check script
67-
ansible.builtin.copy:
68-
src: healthchecks/logrotate_crond/
69-
dest: /var/lib/openstack/healthchecks/logrotate_crond
70-
setype: container_file_t
71-
owner: "{{ ansible_user | default(ansible_user_id) }}"
72-
group: "{{ ansible_user | default(ansible_user_id) }}"
73-
mode: '0700'
74-
become: true

roles/edpm_logrotate_crond/tasks/run.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17+
- name: Update logrotate_crond health check script
18+
ansible.builtin.include_tasks:
19+
file: healthchecks.yml
1720

1821
- name: Manage logrotate_crond containers
1922
ansible.builtin.include_role:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
- name: Gather user fact
4+
ansible.builtin.setup:
5+
gather_subset:
6+
- "!all"
7+
- "!min"
8+
- "user"
9+
when:
10+
- ansible_user is undefined
11+
12+
- name: Ensure base directory for health checks exists
13+
become: true
14+
ansible.builtin.file:
15+
path: /var/lib/openstack/healthchecks
16+
state: directory
17+
setype: container_file_t
18+
owner: "{{ ansible_user | default(ansible_user_id) }}"
19+
group: "{{ ansible_user | default(ansible_user_id) }}"
20+
mode: '0755'
21+
22+
- name: Deploy multipathd health check script
23+
become: true
24+
ansible.builtin.copy:
25+
src: healthchecks/multipathd/
26+
dest: /var/lib/openstack/healthchecks/multipathd
27+
setype: container_file_t
28+
owner: "{{ ansible_user | default(ansible_user_id) }}"
29+
group: "{{ ansible_user | default(ansible_user_id) }}"
30+
mode: '0700'

roles/edpm_multipathd/tasks/install.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,3 @@
6262
mode: "0755"
6363
setype: container_file_t
6464

65-
- name: Create a directory for container health checks
66-
ansible.builtin.file:
67-
path: /var/lib/openstack/healthchecks
68-
state: directory
69-
setype: container_file_t
70-
owner: "{{ ansible_user | default(ansible_user_id) }}"
71-
group: "{{ ansible_user | default(ansible_user_id) }}"
72-
mode: '0755'
73-
74-
- name: Deploy multipathd health check script
75-
ansible.builtin.copy:
76-
src: healthchecks/multipathd/
77-
dest: /var/lib/openstack/healthchecks/multipathd
78-
setype: container_file_t
79-
owner: "{{ ansible_user | default(ansible_user_id) }}"
80-
group: "{{ ansible_user | default(ansible_user_id) }}"
81-
mode: '0700'

roles/edpm_multipathd/tasks/run.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
name: edpm_container_manage
2020
tasks_from: shutdown.yml
2121

22+
- name: Update multipathd health check script
23+
ansible.builtin.include_tasks:
24+
file: healthchecks.yml
25+
2226
- name: Manage multipathd containers
2327
ansible.builtin.include_role:
2428
name: edpm_container_standalone
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
- name: Gather user fact
4+
ansible.builtin.setup:
5+
gather_subset:
6+
- "!all"
7+
- "!min"
8+
- "user"
9+
when:
10+
- ansible_user is undefined
11+
12+
- name: Ensure base directory for health checks exists
13+
become: true
14+
ansible.builtin.file:
15+
path: /var/lib/openstack/healthchecks
16+
state: directory
17+
setype: container_file_t
18+
owner: "{{ ansible_user | default(ansible_user_id) }}"
19+
group: "{{ ansible_user | default(ansible_user_id) }}"
20+
mode: '0755'
21+
22+
- name: Deploy ovn_metadata_agent health check script
23+
become: true
24+
ansible.builtin.copy:
25+
src: healthchecks/ovn_metadata_agent/
26+
dest: /var/lib/openstack/healthchecks/ovn_metadata_agent
27+
setype: container_file_t
28+
owner: "{{ ansible_user | default(ansible_user_id) }}"
29+
group: "{{ ansible_user | default(ansible_user_id) }}"
30+
mode: '0700'

0 commit comments

Comments
 (0)