Skip to content

Commit

Permalink
ceph-handler: Fix osd handler in check mode
Browse files Browse the repository at this point in the history
Run the Ceph commands that only gather information (without making any changes
to the cluster) when running Ansible in check mode.

This allows the tasks that depend on the variables set by those tasks to
succeed in check mode.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 498acd7)
  • Loading branch information
BenoitKnecht authored and guits committed Aug 2, 2021
1 parent 9ee4401 commit f947847
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/ceph-handler/tasks/handler_osds.yml
Expand Up @@ -44,13 +44,15 @@
delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
run_once: true
changed_when: false
check_mode: false

- name: get balancer module status
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
register: balancer_status
run_once: true
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
check_mode: false

- name: set_fact pools_pgautoscaler_mode
set_fact:
Expand Down

0 comments on commit f947847

Please sign in to comment.