From 8e939dc37792d34468b45b096664a3e921c89e77 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 20 Jul 2021 11:38:44 -0400 Subject: [PATCH] common: remove unnecessary run_once statements 1303611 introduced tasks for disabling the pg_autoscaler on pools and the balancer but thoses tasks are already executed on the first monitor node so we don't need to add the run_once statement. Signed-off-by: Dimitri Savineau (cherry picked from commit 738fa9428a3c0c9ed0dd1aec566e807ad072daad) --- infrastructure-playbooks/rolling_update.yml | 6 ------ ...rom-non-containerized-to-containerized-ceph-daemons.yml | 7 ------- 2 files changed, 13 deletions(-) diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 9ccfa8197..be5f27566 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -392,25 +392,21 @@ - name: get balancer module status command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json" register: balancer_status - run_once: true changed_when: false - name: set_fact pools_pgautoscaler_mode set_fact: pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" - run_once: true with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" - name: disable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" - run_once: true changed_when: false when: (balancer_status.stdout | from_json)['active'] | bool - name: disable pg autoscale on pools command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off" with_items: "{{ pools_pgautoscaler_mode }}" - run_once: true when: - pools_pgautoscaler_mode is defined - item.mode == 'on' @@ -525,7 +521,6 @@ - name: re-enable pg autoscale on pools command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on" with_items: "{{ pools_pgautoscaler_mode }}" - run_once: true when: - pools_pgautoscaler_mode is defined - item.mode == 'on' @@ -544,7 +539,6 @@ - name: re-enable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on" - run_once: true changed_when: false when: (balancer_status.stdout | from_json)['active'] | bool 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 667e95900..998f02e94 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 @@ -217,31 +217,26 @@ - name: get pool list command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json" register: pool_list - run_once: true changed_when: false - name: get balancer module status command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json" register: balancer_status - run_once: true changed_when: false - name: set_fact pools_pgautoscaler_mode set_fact: pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}" - run_once: true with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}" - name: disable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off" - run_once: true changed_when: false when: (balancer_status.stdout | from_json)['active'] | bool - name: disable pg autoscale on pools command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off" with_items: "{{ pools_pgautoscaler_mode }}" - run_once: true when: - pools_pgautoscaler_mode is defined - item.mode == 'on' @@ -407,7 +402,6 @@ - name: re-enable pg autoscale on pools command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on" with_items: "{{ pools_pgautoscaler_mode }}" - run_once: true when: - pools_pgautoscaler_mode is defined - item.mode == 'on' @@ -426,7 +420,6 @@ - name: re-enable balancer command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on" - run_once: true changed_when: false when: (balancer_status.stdout | from_json)['active'] | bool -- 2.47.3