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>
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
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:
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