ceph-ansible/roles/ceph-rbd-mirror/tasks/pre_requisite.yml

52 lines
1.7 KiB
YAML
Raw Normal View History

---
- name: install dependencies
# XXX Determine what RH repository this will belong to so that it can be
# properly checked and errored if the repository is not enabled.
package:
name: rbd-mirror
state: present
tags:
- package-install
- name: copy ceph admin key
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
dest: "/etc/ceph/{{ cluster }}.client.admin.keyring"
owner: "ceph"
group: "ceph"
mode: "0600"
when:
- cephx
- ceph_release_num[ceph_release] < ceph_release_num.luminous or copy_admin_key
- name: copy rbd-mirror bootstrap key
copy:
src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring"
dest: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring"
owner: "ceph"
group: "ceph"
mode: "0600"
when:
- cephx
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
- name: create rbd-mirror keyring
command: ceph --cluster {{ cluster }} --name client.bootstrap-rbd --keyring /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring auth get-or-create client.rbd-mirror.{{ ansible_hostname }} mon 'profile rbd' 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
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
- name: set rbd-mirror key permissions
file:
path: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
owner: "ceph"
group: "ceph"
mode: "0600"
when:
- cephx
- ceph_release_num[ceph_release] >= ceph_release_num.luminous