mirror of https://github.com/ceph/ceph-ansible.git
common: remove unnecessary run_once statements
pull/6745/head v4.0.621303611
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 <dsavinea@redhat.com> (cherry picked from commit738fa9428a
)
parent
17b9ff03d2
commit
8e939dc377
|
@ -392,25 +392,21 @@
|
||||||
- name: get balancer module status
|
- name: get balancer module status
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
|
||||||
register: balancer_status
|
register: balancer_status
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: set_fact pools_pgautoscaler_mode
|
- name: set_fact pools_pgautoscaler_mode
|
||||||
set_fact:
|
set_fact:
|
||||||
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
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'] }}"
|
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}"
|
||||||
|
|
||||||
- name: disable balancer
|
- name: disable balancer
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: (balancer_status.stdout | from_json)['active'] | bool
|
when: (balancer_status.stdout | from_json)['active'] | bool
|
||||||
|
|
||||||
- name: disable pg autoscale on pools
|
- name: disable pg autoscale on pools
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off"
|
||||||
with_items: "{{ pools_pgautoscaler_mode }}"
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
||||||
run_once: true
|
|
||||||
when:
|
when:
|
||||||
- pools_pgautoscaler_mode is defined
|
- pools_pgautoscaler_mode is defined
|
||||||
- item.mode == 'on'
|
- item.mode == 'on'
|
||||||
|
@ -525,7 +521,6 @@
|
||||||
- name: re-enable pg autoscale on pools
|
- name: re-enable pg autoscale on pools
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on"
|
||||||
with_items: "{{ pools_pgautoscaler_mode }}"
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
||||||
run_once: true
|
|
||||||
when:
|
when:
|
||||||
- pools_pgautoscaler_mode is defined
|
- pools_pgautoscaler_mode is defined
|
||||||
- item.mode == 'on'
|
- item.mode == 'on'
|
||||||
|
@ -544,7 +539,6 @@
|
||||||
|
|
||||||
- name: re-enable balancer
|
- name: re-enable balancer
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on"
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: (balancer_status.stdout | from_json)['active'] | bool
|
when: (balancer_status.stdout | from_json)['active'] | bool
|
||||||
|
|
||||||
|
|
|
@ -217,31 +217,26 @@
|
||||||
- name: get pool list
|
- name: get pool list
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd dump -f json"
|
||||||
register: pool_list
|
register: pool_list
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: get balancer module status
|
- name: get balancer module status
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
|
||||||
register: balancer_status
|
register: balancer_status
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: set_fact pools_pgautoscaler_mode
|
- name: set_fact pools_pgautoscaler_mode
|
||||||
set_fact:
|
set_fact:
|
||||||
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
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'] }}"
|
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}"
|
||||||
|
|
||||||
- name: disable balancer
|
- name: disable balancer
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: (balancer_status.stdout | from_json)['active'] | bool
|
when: (balancer_status.stdout | from_json)['active'] | bool
|
||||||
|
|
||||||
- name: disable pg autoscale on pools
|
- name: disable pg autoscale on pools
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off"
|
||||||
with_items: "{{ pools_pgautoscaler_mode }}"
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
||||||
run_once: true
|
|
||||||
when:
|
when:
|
||||||
- pools_pgautoscaler_mode is defined
|
- pools_pgautoscaler_mode is defined
|
||||||
- item.mode == 'on'
|
- item.mode == 'on'
|
||||||
|
@ -407,7 +402,6 @@
|
||||||
- name: re-enable pg autoscale on pools
|
- name: re-enable pg autoscale on pools
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on"
|
||||||
with_items: "{{ pools_pgautoscaler_mode }}"
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
||||||
run_once: true
|
|
||||||
when:
|
when:
|
||||||
- pools_pgautoscaler_mode is defined
|
- pools_pgautoscaler_mode is defined
|
||||||
- item.mode == 'on'
|
- item.mode == 'on'
|
||||||
|
@ -426,7 +420,6 @@
|
||||||
|
|
||||||
- name: re-enable balancer
|
- name: re-enable balancer
|
||||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on"
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on"
|
||||||
run_once: true
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: (balancer_status.stdout | from_json)['active'] | bool
|
when: (balancer_status.stdout | from_json)['active'] | bool
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue