From 81233dd96300d47a6781dd3287555c18beb6253f Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 5 Nov 2020 14:59:33 +0100 Subject: [PATCH] rgw: call `ceph_ec_profile` when needed Let's replace `command` tasks with `ceph_ec_profile` calls Signed-off-by: Guillaume Abrioux --- roles/ceph-rgw/tasks/rgw_create_pools.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/roles/ceph-rgw/tasks/rgw_create_pools.yml b/roles/ceph-rgw/tasks/rgw_create_pools.yml index 74a3a398a..a4c1cc897 100644 --- a/roles/ceph-rgw/tasks/rgw_create_pools.yml +++ b/roles/ceph-rgw/tasks/rgw_create_pools.yml @@ -1,22 +1,17 @@ --- -- name: remove ec profile - command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile rm {{ item.value.ec_profile }}" - loop: "{{ rgw_create_pools | dict2items }}" +- name: create ec profile + ceph_ec_profile: + name: "{{ item.value.ec_profile }}" + k: "{{ item.value.ec_k }}" + m: "{{ item.value.ec_m }}" delegate_to: "{{ groups[mon_group_name][0] }}" - changed_when: false - when: - - item.value.type is defined - - item.value.type == 'ec' - failed_when: false - -- name: set ec profile - command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile set {{ item.value.ec_profile }} k={{ item.value.ec_k }} m={{ item.value.ec_m }}" loop: "{{ rgw_create_pools | dict2items }}" - delegate_to: "{{ groups[mon_group_name][0] }}" - changed_when: false when: - item.value.type is defined - item.value.type == 'ec' + environment: + CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}" + CEPH_CONTAINER_BINARY: "{{ container_binary }}" - name: set crush rule command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd crush rule create-erasure {{ item.key }} {{ item.value.ec_profile }}" -- 2.39.5