Skip to content

Commit

Permalink
common: fix target_size_ratio task enablement
Browse files Browse the repository at this point in the history
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 8c7a488)
  • Loading branch information
guits authored and dsavineau committed Jun 3, 2020
1 parent 4969ea7 commit d790375
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion roles/ceph-client/tasks/create_users_keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
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') }}"
Expand Down
4 changes: 3 additions & 1 deletion roles/ceph-mds/tasks/create_mds_filesystems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}"
Expand Down
4 changes: 3 additions & 1 deletion roles/ceph-osd/tasks/openstack_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}"
Expand Down

0 comments on commit d790375

Please sign in to comment.