kolla-ansible/ansible/roles/ceph/tasks/distribute_keyrings.yml
Michal Nasiadka ad9e8786a3 Add support for sha256 in ceph key distribution
- add support for sha256 in bslurp module
- change sha1 to sha256 in ceph-mon ansible role

Depends-On: https://review.opendev.org/655623
Change-Id: I25e28d150f2a8d4a7f87bb119d9fb1c46cfe926f
Closes-Bug: #1826327
2019-08-07 11:57:46 +00:00

80 lines
2.5 KiB
YAML

---
- name: Fetching Ceph keyrings
become: true
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 | default('')}}"
sha256: "{{ item.sha256 | default('')}}"
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 | default('')}}"
sha256: "{{ item.sha256 | default('')}}"
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 | default('')}}"
sha256: "{{ item.sha256 | default('') }}"
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 | default('')}}"
sha256: "{{ item.sha256 | default('')}}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
- "{{ ceph_files['ceph.client.radosgw.keyring'] }}"
when: inventory_hostname in groups['ceph-rgw']
- name: Pushing Ceph keyrings for NFSs
become: true
bslurp:
src: "{{ item.content }}"
dest: "{{ node_config_directory }}/ceph-nfs/{{ item.filename }}"
sha1: "{{ item.sha1 | default('')}}"
sha256: "{{ item.sha256 | default('')}}"
mode: 0600
with_items:
- "{{ ceph_files['ceph.client.admin.keyring'] }}"
when:
- inventory_hostname in groups['ceph-nfs']
- enable_ceph_nfs | bool