Skip to content

Commit

Permalink
adopt: check for POOL_APP_NOT_ENABLED warning
Browse files Browse the repository at this point in the history
This commit makes the cephadm-adopt playbook fail if the cluster
has the `POOL_APP_NOT_ENABLED` warning raised.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2040243

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit ddae06e)
  • Loading branch information
guits committed Feb 9, 2022
1 parent 9d7e3bf commit cb19757
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@
name: ceph-facts
tasks_from: container_binary.yml

- name: set_fact ceph_cmd
set_fact:
ceph_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:ro -v /var/run/ceph:/var/run/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }} --cluster {{ cluster }}"

- name: check pools have an application enabled
command: "{{ ceph_cmd }} health detail --format json"
register: health_detail
run_once: true
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"

- name: check for POOL_APP_NOT_ENABLED warning
fail:
msg: "Make sure all your pool have an application enabled."
run_once: true
delegate_to: localhost
when:
- (health_detail.stdout | default('{}', True) | from_json)['status'] == "HEALTH_WARN"
- "'POOL_APP_NOT_ENABLED' in (health_detail.stdout | default('{}', True) | from_json)['checks']"

- import_role:
name: ceph-facts
tasks_from: convert_grafana_server_group_name.yml
Expand Down Expand Up @@ -193,10 +213,6 @@
- not containerized_deployment | bool
- mgr_group_name in group_names

- name: set_fact ceph_cmd
set_fact:
ceph_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph:/var/lib/ceph:ro -v /var/run/ceph:/var/run/ceph:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }} --cluster {{ cluster }}"

- name: get current fsid
command: "{{ ceph_cmd }} fsid"
register: current_fsid
Expand Down

0 comments on commit cb19757

Please sign in to comment.