From d7653dca95247e52c4a6821c1eec00748263082a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Mon, 26 Jul 2021 17:10:19 +0200 Subject: [PATCH] infrastructure-playbooks: Get Ceph info in check mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- infrastructure-playbooks/cephadm-adopt.yml | 2 ++ infrastructure-playbooks/rolling_update.yml | 2 ++ ...h-from-non-containerized-to-containerized-ceph-daemons.yml | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 21dcca2cb..ddc2993a3 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -449,6 +449,7 @@ 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" @@ -456,6 +457,7 @@ run_once: true delegate_to: "{{ groups[mon_group_name][0] }}" changed_when: false + check_mode: false - name: set_fact pools_pgautoscaler_mode set_fact: diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 6da698da1..baa7f0e97 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -412,11 +412,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: diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 862e4ffa8..df9b13098 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -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: @@ -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 \ No newline at end of file + changed_when: false