From: Sébastien Han Date: Mon, 10 Dec 2018 14:30:48 +0000 (+0100) Subject: rbd-mirror: copy bootstrap key after package install X-Git-Tag: v4.0.0beta1~79 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2af624dc5b7ea32cc170df995c0a1baf2b4f67a5;p=ceph-ansible.git rbd-mirror: copy bootstrap key after package install 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 --- diff --git a/roles/ceph-rbd-mirror/tasks/common.yml b/roles/ceph-rbd-mirror/tasks/common.yml index ca168ab19..a48a40eeb 100644 --- a/roles/ceph-rbd-mirror/tasks/common.yml +++ b/roles/ceph-rbd-mirror/tasks/common.yml @@ -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 diff --git a/roles/ceph-rbd-mirror/tasks/main.yml b/roles/ceph-rbd-mirror/tasks/main.yml index ccd401571..7b8036cfb 100644 --- a/roles/ceph-rbd-mirror/tasks/main.yml +++ b/roles/ceph-rbd-mirror/tasks/main.yml @@ -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: diff --git a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml index 1adba11ca..7a97097a3 100644 --- a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml +++ b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml @@ -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