Skip to content

Commit

Permalink
Merge pull request #836 from paramite/OSPRH12089-OSPRH12088
Browse files Browse the repository at this point in the history
Fix blocked update because of health checks deployment
  • Loading branch information
openshift-merge-bot[bot] authored Dec 5, 2024
2 parents c05ecdc + 60c6b73 commit c7cc7ed
Show file tree
Hide file tree
Showing 19 changed files with 215 additions and 132 deletions.
30 changes: 30 additions & 0 deletions roles/edpm_iscsid/tasks/healthchecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: Gather user fact
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "user"
when:
- ansible_user is undefined

- name: Ensure base directory for health checks exists
become: true
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy iscsi health check script
become: true
ansible.builtin.copy:
src: healthchecks/iscsid/
dest: "/var/lib/openstack/healthchecks/iscsid"
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
10 changes: 0 additions & 10 deletions roles/edpm_iscsid/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
- {'path': /var/lib/iscsi, 'setype': container_file_t}
- {'path': /var/lib/config-data, 'setype': container_file_t, 'selevel': s0, 'mode': '0755'}
- {'path': /var/lib/config-data/ansible-generated/iscsid, 'setype': container_file_t, 'mode': '0755'}
- {'path': /var/lib/openstack/healthchecks, 'setype': container_file_t, 'mode': '0755'}

- name: Stat /lib/systemd/system/iscsid.socket
ansible.builtin.stat:
Expand All @@ -56,12 +55,3 @@
- ansible_facts.services["iscsi.service"] is defined
- ansible_facts.services["iscsi.service"]["status"] != "not-found"
- ansible_facts.services["iscsi.service"]["status"] == "enabled"

- name: Deploy iscsi health check script
ansible.builtin.copy:
src: healthchecks/iscsid/
dest: "/var/lib/openstack/healthchecks/iscsid"
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
4 changes: 4 additions & 0 deletions roles/edpm_iscsid/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
name: edpm_container_manage
tasks_from: shutdown.yml

- name: Update iscsi health check script
ansible.builtin.include_tasks:
file: healthchecks.yml

- name: Manage iscsid containers
ansible.builtin.include_role:
name: edpm_container_standalone
Expand Down
30 changes: 30 additions & 0 deletions roles/edpm_logrotate_crond/tasks/healthchecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: Gather user fact
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "user"
when:
- ansible_user is undefined

- name: Ensure base directory for health checks exists
become: true
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy logrotate_crond health check script
become: true
ansible.builtin.copy:
src: healthchecks/logrotate_crond/
dest: /var/lib/openstack/healthchecks/logrotate_crond
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
20 changes: 0 additions & 20 deletions roles/edpm_logrotate_crond/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,3 @@
when:
- ansible_facts.selinux is defined
- ansible_facts.selinux.status == "enabled"

- name: Create a directory for container health checks
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'
become: true

- name: Deploy logrotate_crond health check script
ansible.builtin.copy:
src: healthchecks/logrotate_crond/
dest: /var/lib/openstack/healthchecks/logrotate_crond
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
become: true
3 changes: 3 additions & 0 deletions roles/edpm_logrotate_crond/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Update logrotate_crond health check script
ansible.builtin.include_tasks:
file: healthchecks.yml

- name: Manage logrotate_crond containers
ansible.builtin.include_role:
Expand Down
30 changes: 30 additions & 0 deletions roles/edpm_multipathd/tasks/healthchecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: Gather user fact
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "user"
when:
- ansible_user is undefined

- name: Ensure base directory for health checks exists
become: true
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy multipathd health check script
become: true
ansible.builtin.copy:
src: healthchecks/multipathd/
dest: /var/lib/openstack/healthchecks/multipathd
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
18 changes: 0 additions & 18 deletions roles/edpm_multipathd/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,3 @@
state: directory
mode: "0755"
setype: container_file_t

- name: Create a directory for container health checks
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy multipathd health check script
ansible.builtin.copy:
src: healthchecks/multipathd/
dest: /var/lib/openstack/healthchecks/multipathd
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
4 changes: 4 additions & 0 deletions roles/edpm_multipathd/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
name: edpm_container_manage
tasks_from: shutdown.yml

- name: Update multipathd health check script
ansible.builtin.include_tasks:
file: healthchecks.yml

- name: Manage multipathd containers
ansible.builtin.include_role:
name: edpm_container_standalone
Expand Down
30 changes: 30 additions & 0 deletions roles/edpm_neutron_metadata/tasks/healthchecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: Gather user fact
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "user"
when:
- ansible_user is undefined

- name: Ensure base directory for health checks exists
become: true
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy ovn_metadata_agent health check script
become: true
ansible.builtin.copy:
src: healthchecks/ovn_metadata_agent/
dest: /var/lib/openstack/healthchecks/ovn_metadata_agent
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
11 changes: 0 additions & 11 deletions roles/edpm_neutron_metadata/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
- {'path': "{{ edpm_neutron_metadata_agent_lib_dir }}/kill_scripts", "mode": "0755"}
- {'path': "{{ edpm_neutron_metadata_agent_lib_dir }}/ovn-metadata-proxy", "mode": "0755"}
- {'path': "{{ edpm_neutron_metadata_agent_lib_dir }}/external/pids", "mode": "0755"}
- {'path': /var/lib/openstack/healthchecks, "mode": "0755"}

- name: Gather SELinux fact if needed
when:
Expand Down Expand Up @@ -75,13 +74,3 @@
mode: "0755"
with_items:
- {"src": "wrappers/kill-script.j2", "dest": "haproxy-kill"}

- name: Deploy ovn_metadata_agent health check script
ansible.builtin.copy:
src: healthchecks/ovn_metadata_agent/
dest: /var/lib/openstack/healthchecks/ovn_metadata_agent
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
become: true
4 changes: 4 additions & 0 deletions roles/edpm_neutron_metadata/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
name: edpm_container_manage
tasks_from: shutdown.yml

- name: Update ovn_metadata_agent health check script
ansible.builtin.include_tasks:
file: healthchecks.yml

- name: Run ovn_metadata_agent container
ansible.builtin.include_role:
name: osp.edpm.edpm_container_standalone
Expand Down
30 changes: 30 additions & 0 deletions roles/edpm_ovn/tasks/healthchecks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: Gather user fact
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "user"
when:
- ansible_user is undefined

- name: Ensure base directory for health checks exists
become: true
ansible.builtin.file:
path: /var/lib/openstack/healthchecks
state: directory
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0755'

- name: Deploy ovn_controller health check script
become: true
ansible.builtin.copy:
src: healthchecks/ovn_controller/
dest: /var/lib/openstack/healthchecks/ovn_controller
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
12 changes: 0 additions & 12 deletions roles/edpm_ovn/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
loop:
- {'path': /var/lib/edpm-config/firewall, 'mode': '0750'}
- {'path': /var/lib/openvswitch/ovn, "owner": "openvswitch", "group": "openvswitch"}
- {'path': /var/lib/openstack/healthchecks, 'mode': '0755'}


- name: Gather SELinux fact if needed
when:
Expand All @@ -55,13 +53,3 @@
when:
- ansible_facts.selinux is defined
- ansible_facts.selinux.status == "enabled"

- name: Deploy ovn_controller health check script
ansible.builtin.copy:
src: healthchecks/ovn_controller/
dest: /var/lib/openstack/healthchecks/ovn_controller
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
become: true
4 changes: 4 additions & 0 deletions roles/edpm_ovn/tasks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
name: edpm_container_manage
tasks_from: shutdown.yml

- name: Update ovn_controller health check script
ansible.builtin.include_tasks:
file: healthchecks.yml

- name: Run ovn_controller container
ansible.builtin.include_role:
name: osp.edpm.edpm_container_standalone
Expand Down
4 changes: 4 additions & 0 deletions roles/edpm_telemetry/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ edpm_telemetry_healthcheck_sources:
# kepler: exporter
# If telemetry services should have health checks enabled
edpm_telemetry_healthcheck: true
# List of exporters to be deployed in the compute node
edpm_telemetry_enabled_exporters:
- ceilometer_agent_compute
- node_exporter
4 changes: 4 additions & 0 deletions roles/edpm_telemetry/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ argument_specs:
Contains information about distribution of container health check scripts.
Keys state for container names and value is name of a script directory
from module's files directory.
edpm_telemetry_enabled_exporters:
type: list
required: true
description: "List of exporters to be deployed in the compute node"
26 changes: 26 additions & 0 deletions roles/edpm_telemetry/tasks/exporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

- name: Deploy health check script
ansible.builtin.copy:
src: "healthchecks/{{ edpm_telemetry_healthcheck_sources[exporter] }}/"
dest: "/var/lib/openstack/healthchecks/{{ exporter }}"
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
become: true

- name: Deploy exporter container
ansible.builtin.include_role:
name: osp.edpm.edpm_container_manage
vars:
edpm_container_manage_config: "{{ edpm_telemetry_config_dest }}"
edpm_container_manage_healthcheck_disabled: true
edpm_container_manage_config_patterns: "{{ exporter }}.json"
edpm_container_manage_clean_orphans: false

- name: Restart exporter container
become: true
ansible.builtin.systemd:
state: restarted
name: "edpm_{{ exporter }}.service"
Loading

0 comments on commit c7cc7ed

Please sign in to comment.