Skip to content

Commit

Permalink
Disable podman_exporter deployment by default
Browse files Browse the repository at this point in the history
We need to disable podman_exporter deployment by default until we get
the exporter image downstream.

Resolves: OSPRH-12089
  • Loading branch information
paramite committed Dec 4, 2024
1 parent 3c56f2b commit 5a52e70
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 53 deletions.
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 ceilometer agents to be stopped during EDPM adoption
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"
78 changes: 25 additions & 53 deletions roles/edpm_telemetry/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,69 +24,41 @@
mode: '0755'
become: true

- name: Deploy telemetry health check scripts
ansible.builtin.copy:
src: "healthchecks/{{ item.value }}/"
dest: "/var/lib/openstack/healthchecks/{{ item.key }}"
setype: container_file_t
owner: "{{ ansible_user | default(ansible_user_id) }}"
group: "{{ ansible_user | default(ansible_user_id) }}"
mode: '0700'
- name: Start podman.socket service
ansible.builtin.systemd_service:
name: podman.socket
state: started
enabled: true
become: true
loop: "{{ edpm_telemetry_healthcheck_sources | dict2items }}"

- name: Deploy ceilometer containers
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: "ceilometer_agent_compute.json"
edpm_container_manage_clean_orphans: false
when: '"podman_exporter" in edpm_telemetry_enabled_exporters'

- name: Deploy node_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: "node_exporter.json"
edpm_container_manage_clean_orphans: false

- name: Deploy podman_exporter container
- name: Deploy enabled exporters
block:
- name: Start podman.socket service
ansible.builtin.systemd_service:
name: podman.socket
state: started
enabled: true
- 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: Start podman_exporter container
- 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: "podman_exporter.json"
edpm_container_manage_config_patterns: "{{ exporter }}.json"
edpm_container_manage_clean_orphans: false

- name: Restart node_exporter
become: true
ansible.builtin.systemd:
state: restarted
name: edpm_node_exporter.service

- name: Restart podman_exporter
become: true
ansible.builtin.systemd:
state: restarted
name: edpm_podman_exporter.service

- name: Restart ceilometer compute
become: true
ansible.builtin.systemd:
state: restarted
name: edpm_ceilometer_agent_compute.service
- name: Restart exporter container
become: true
ansible.builtin.systemd:
state: restarted
name: "edpm_{{ exporter }}.service"
loop: "{{ edpm_telemetry_enabled_exporters }}"
loop_control:
loop_var: exporter

- name: List deployed health check scripts
ansible.builtin.find:
Expand Down

0 comments on commit 5a52e70

Please sign in to comment.