kolla-ansible/ansible/roles/ceph/tasks/distribute_keyrings.yml
wu.chunyang 8cf67e9a87 Fix the ceph-mgr connect to cluster failed
For luminous, the ceph_mgr service provide the
dashborad for ceph, and it need connect to cluster,
but now it failed to connect ceph cluster due to
ceph.client.admin.keyring missing, this ps to fix it.

Co-Authored-By: chenqiaomin <chen.qiaomin@99cloud.net>
Closes-Bug: #1768462

Change-Id: Idb24661bc5674780db390220ca02e22975490663
2018-05-02 16:44:18 +08:00

61 lines
1.9 KiB
YAML

---
- name: Fetching Ceph keyrings
command: docker exec ceph_mon fetch_ceph_keys.py
register: ceph_files_json
changed_when: (ceph_files_json.stdout | from_json).changed
failed_when: (ceph_files_json.stdout | from_json).failed
delegate_to: "{{ delegate_host }}"
run_once: True
- name: Reading json from variable
set_fact:
ceph_files: "{{ (ceph_files_json.stdout | from_json) }}"
- name: Pushing Ceph keyring for OSDs
become: true
bslurp:
src: "{{ item.content }}"
dest: "{{ node_config_directory }}/ceph-osd/{{ item.filename }}"
sha1: "{{ item.sha1 }}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
when: inventory_hostname in groups['ceph-osd']
- name: Pushing Ceph keyrings for Mons
become: true
bslurp:
src: "{{ item.content }}"
dest: "{{ node_config_directory }}/ceph-mon/{{ item.filename }}"
sha1: "{{ item.sha1 }}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
- "{{ ceph_files['ceph.client.mon.keyring'] }}"
- "{{ ceph_files['ceph.client.radosgw.keyring'] }}"
- "{{ ceph_files['ceph.monmap'] }}"
when: inventory_hostname in groups['ceph-mon']
- name: Pushing Ceph keyrings for Mgrs
become: true
bslurp:
src: "{{ item.content }}"
dest: "{{ node_config_directory }}/ceph-mgr/{{ item.filename }}"
sha1: "{{ item.sha1 }}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
when: inventory_hostname in groups['ceph-mgr']
- name: Pushing Ceph keyrings for RGWs
become: true
bslurp:
src: "{{ item.content }}"
dest: "{{ node_config_directory }}/ceph-rgw/{{ item.filename }}"
sha1: "{{ item.sha1 }}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
- "{{ ceph_files['ceph.client.radosgw.keyring'] }}"
when: inventory_hostname in groups['ceph-rgw']