aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/ceph/tasks/distribute_keyrings.yml
blob: ea4952a42a23976fb1e6db2c98f905006c1b521d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- 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
  bslurp:
    src: "{{ item.content }}"
    dest: "{{ node_config_directory }}/ceph-osd/{{ item.filename }}"
    mode: 0600
    sha1: "{{ item.sha1 }}"
  with_items:
    - "{{ ceph_files['ceph.client.admin.keyring'] }}"
  when: inventory_hostname in groups['ceph-osd']

- name: Pushing Ceph keyrings for Mons
  bslurp:
    src: "{{ item.content }}"
    dest: "{{ node_config_directory }}/ceph-mon/{{ item.filename }}"
    mode: 0600
    sha1: "{{ item.sha1 }}"
  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 RGWs
  bslurp:
    src: "{{ item.content }}"
    dest: "{{ node_config_directory }}/ceph-rgw/{{ item.filename }}"
    mode: 0600
    sha1: "{{ item.sha1 }}"
  with_items:
    - "{{ ceph_files['ceph.client.admin.keyring'] }}"
    - "{{ ceph_files['ceph.client.radosgw.keyring'] }}"
  when: inventory_hostname in groups['ceph-rgw']