Skip to content

Commit

Permalink
infrastructure-playbooks: Get Ceph info in check mode
Browse files Browse the repository at this point in the history
In the `set osd flags` block, run the Ceph commands that gather information
from the cluster (and don't make any changes to it) even when running 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 d7653dc)
  • Loading branch information
BenoitKnecht authored and guits committed Aug 2, 2021
1 parent f947847 commit 35ce2bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions infrastructure-playbooks/cephadm-adopt.yml
Expand Up @@ -420,13 +420,15 @@
run_once: true
delegate_to: "{{ groups[mon_group_name][0] }}"
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
2 changes: 2 additions & 0 deletions infrastructure-playbooks/rolling_update.yml
Expand Up @@ -405,11 +405,13 @@
register: pool_list
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
changed_when: false
check_mode: false

- name: set_fact pools_pgautoscaler_mode
set_fact:
Expand Down
Expand Up @@ -219,11 +219,13 @@
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json"
register: pool_list
changed_when: false
check_mode: false

- name: get balancer module status
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
register: balancer_status
changed_when: false
check_mode: false

- name: set_fact pools_pgautoscaler_mode
set_fact:
Expand Down Expand Up @@ -749,4 +751,4 @@
# as in this case we know we want all owned by ceph user
- name: set proper ownership on ceph directories
command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
changed_when: false
changed_when: false

0 comments on commit 35ce2bb

Please sign in to comment.