]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: fix target_size_ratio task enablement
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 14 May 2020 09:00:12 +0000 (11:00 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 19 May 2020 13:15:03 +0000 (15:15 +0200)
The condition on this task is wrong, we have to check whether
`target_size_ratio` is set in the pool definition instead.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8c7a48832cd62524982c9ebe193a5ca6ea2c7bfa)

roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml
roles/ceph-osd/tasks/openstack_config.yml

index 2452357b15c6d58675ea224424cd781d6b8c2fee..68b1ae02d2bf1ef74c6232c675f19d2223713f1a 100644 (file)
       command: "{{ ceph_admin_command | default('') }} --cluster {{ cluster }} osd pool set {{ item.name }} target_size_ratio {{ item.target_size_ratio }}"
       with_items: "{{ pools | unique }}"
       delegate_to: "{{ delegated_node }}"
-      when: item.pg_autoscale_mode | default(False) | bool
+      when:
+        - item.pg_autoscale_mode | default(False) | bool
+        - item.target_size_ratio is defined
 
     - name: set pg_autoscale_mode value on pool(s)
       command: "{{ ceph_admin_command | default('') }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode {{ item.pg_autoscale_mode | default(False) | ternary('on', 'warn') }}"
index 9dfde4b69eba03ae6288e48992aed85f5b964232..abd60ce5ad1fa3f789a80f0a7d16f1faedf50923 100644 (file)
@@ -46,7 +46,9 @@
         - name: set the target ratio on pool(s)
           command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} target_size_ratio {{ item.target_size_ratio }}"
           with_items: "{{ cephfs_pools | unique }}"
-          when: item.pg_autoscale_mode | default(False) | bool
+          when:
+            - item.pg_autoscale_mode | default(False) | bool
+            - item.target_size_ratio is defined
 
         - name: set pg_autoscale_mode value on pool(s)
           command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode {{ item.pg_autoscale_mode | default(False) | ternary('on', 'warn') }}"
index 7f4fd21281ed8472a194f075b927d9f50a37ce1d..99d8f409f1820e73e5afaf85cb1a3712c9656096 100644 (file)
@@ -36,7 +36,9 @@
       command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} target_size_ratio {{ item.target_size_ratio }}"
       with_items: "{{ openstack_pools | unique }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
-      when: item.pg_autoscale_mode | default(False) | bool
+      when:
+        - item.pg_autoscale_mode | default(False) | bool
+        - item.target_size_ratio is defined
 
     - name: set pg_autoscale_mode value on pool(s)
       command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode {{ item.pg_autoscale_mode | default(False) | ternary('on', 'warn') }}"