2016-02-18 06:15:57 +08:00
|
|
|
---
|
|
|
|
- name: find ceph keys
|
|
|
|
shell: ls -1 /etc/ceph/*.keyring
|
|
|
|
changed_when: false
|
|
|
|
register: ceph_keys
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2016-02-18 06:15:57 +08:00
|
|
|
|
|
|
|
- name: set keys permissions
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
2018-06-25 21:12:56 +08:00
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2016-02-18 06:15:57 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact bootstrap_rbd_keyring
|
2017-08-11 20:31:55 +08:00
|
|
|
set_fact:
|
|
|
|
bootstrap_rbd_keyring: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring"
|
2017-10-13 00:27:36 +08:00
|
|
|
when: ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
2017-08-11 20:31:55 +08:00
|
|
|
|
2016-02-18 06:15:57 +08:00
|
|
|
- name: copy keys to the ansible server
|
|
|
|
fetch:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
|
|
|
|
flat: yes
|
|
|
|
run_once: true
|
|
|
|
with_items:
|
|
|
|
- "{{ ceph_keys.stdout_lines }}"
|
2016-10-07 14:06:21 +08:00
|
|
|
- "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring"
|
|
|
|
- "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring"
|
|
|
|
- "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring"
|
2017-08-11 20:31:55 +08:00
|
|
|
- "{{ bootstrap_rbd_keyring | default([]) }}"
|