]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rgw: call `ceph_ec_profile` when needed
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 5 Nov 2020 13:59:33 +0000 (14:59 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 24 Nov 2020 09:38:28 +0000 (10:38 +0100)
Let's replace `command` tasks with `ceph_ec_profile` calls

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-rgw/tasks/rgw_create_pools.yml

index 74a3a398ab4a53daa3d822c3c854fbcc20520b52..a4c1cc897edce3f9fb0526f1e8b100508904fdc2 100644 (file)
@@ -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 }}"