]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rbd-mirror: copy bootstrap key after package install
authorSébastien Han <seb@redhat.com>
Mon, 10 Dec 2018 14:30:48 +0000 (15:30 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 4 Jan 2019 13:57:40 +0000 (13:57 +0000)
If we don't copy the key after the package install the directory /var/lib/ceph/bootstrap-rbd-mirror
will not exist and the copy will fail.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-rbd-mirror/tasks/common.yml
roles/ceph-rbd-mirror/tasks/main.yml
roles/ceph-rbd-mirror/tasks/pre_requisite.yml

index ca168ab19ce95ad4cb357ef0f6dc6d371d7532ed..a48a40eeb8aa20dfc42d4fcf2233bb42f9a5fc6a 100644 (file)
@@ -6,5 +6,26 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
+
+- name: create rbd-mirror keyring
+  command: >
+    ceph --cluster {{ cluster }}
+    --name client.bootstrap-rbd-mirror
+    --keyring /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring
+    auth get-or-create client.rbd-mirror.{{ ansible_hostname }}
+    mon 'profile rbd-mirror'
+    osd 'profile rbd'
+    -o /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
+  args:
+    creates: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
   when:
-    - cephx
\ No newline at end of file
+    - not containerized_deployment
+
+- name: set rbd-mirror key permissions
+  file:
+    path: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
+    owner: "ceph"
+    group: "ceph"
+    mode: "{{ ceph_keyring_permissions }}"
+  when:
+    - not containerized_deployment
\ No newline at end of file
index ccd401571180dd15a9f781cf9fc03c5e22aea15c..7b8036cfb39b68976f86d7c078537df5c262316f 100644 (file)
@@ -5,14 +5,16 @@
   when:
     - containerized_deployment
 
-- name: include common.yml
-  include_tasks: common.yml
-
 - name: include pre_requisite.yml
   include_tasks: pre_requisite.yml
   when:
     - not containerized_deployment
 
+- name: include common.yml
+  include_tasks: common.yml
+  when:
+    - cephx
+
 - name: include start_rbd_mirror.yml
   include_tasks: start_rbd_mirror.yml
   when:
index 1adba11cad384f6f33740e17898532fada76c8fc..7a97097a356de0e25dcaa214f3535b0fcc8ec3f4 100644 (file)
@@ -8,28 +8,4 @@
   register: result
   until: result is succeeded
   tags:
-    - package-install
-
-- name: create rbd-mirror keyring
-  command: >
-    ceph --cluster {{ cluster }}
-    --name client.bootstrap-rbd-mirror
-    --keyring /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring
-    auth get-or-create client.rbd-mirror.{{ ansible_hostname }}
-    mon 'profile rbd-mirror'
-    osd 'profile rbd'
-    -o /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
-  args:
-    creates: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
-  changed_when: false
-  when:
-    - cephx
-
-- name: set rbd-mirror key permissions
-  file:
-    path: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
-    owner: "ceph"
-    group: "ceph"
-    mode: "{{ ceph_keyring_permissions }}"
-  when:
-    - cephx
\ No newline at end of file
+    - package-install
\ No newline at end of file