Skip to content

Commit cb19757

Browse files
committedFeb 9, 2022
adopt: check for POOL_APP_NOT_ENABLED warning
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)
1 parent 9d7e3bf commit cb19757

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed
 

‎infrastructure-playbooks/cephadm-adopt.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@
8686
name: ceph-facts
8787
tasks_from: container_binary.yml
8888

89+
- name: set_fact ceph_cmd
90+
set_fact:
91+
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 }}"
92+
93+
- name: check pools have an application enabled
94+
command: "{{ ceph_cmd }} health detail --format json"
95+
register: health_detail
96+
run_once: true
97+
changed_when: false
98+
delegate_to: "{{ groups[mon_group_name][0] }}"
99+
100+
- name: check for POOL_APP_NOT_ENABLED warning
101+
fail:
102+
msg: "Make sure all your pool have an application enabled."
103+
run_once: true
104+
delegate_to: localhost
105+
when:
106+
- (health_detail.stdout | default('{}', True) | from_json)['status'] == "HEALTH_WARN"
107+
- "'POOL_APP_NOT_ENABLED' in (health_detail.stdout | default('{}', True) | from_json)['checks']"
108+
89109
- import_role:
90110
name: ceph-facts
91111
tasks_from: convert_grafana_server_group_name.yml
@@ -193,10 +213,6 @@
193213
- not containerized_deployment | bool
194214
- mgr_group_name in group_names
195215

196-
- name: set_fact ceph_cmd
197-
set_fact:
198-
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 }}"
199-
200216
- name: get current fsid
201217
command: "{{ ceph_cmd }} fsid"
202218
register: current_fsid

0 commit comments

Comments
 (0)