]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-fetch-keys: refact
authorSébastien Han <seb@redhat.com>
Thu, 27 Sep 2018 14:29:22 +0000 (16:29 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Wed, 17 Oct 2018 11:26:11 +0000 (11:26 +0000)
This commits simplies the usage of the ceph-fetch-keys role. The role
now has a nicer way to find various ceph keys and fetch them on the
ansible server.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1624962
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-fetch-keys/tasks/main.yml

index 61f2f3a58e5c9bccdf6038760f63e33f5d495889..5957093c00f318eb2ec75dc229b41f26769f9474 100644 (file)
@@ -1,24 +1,16 @@
 ---
-- name: find ceph keys
+- name: lookup keys in /etc/ceph
   shell: ls -1 /etc/ceph/*.keyring
   changed_when: false
   register: ceph_keys
-  check_mode: no
 
-- name: set keys permissions
-  file:
-    path: "{{ item }}"
-    mode: "{{ ceph_keyring_permissions }}"
-    owner: root
-    group: root
-  with_items:
-    - "{{ ceph_keys.stdout_lines }}"
 
-- name: copy keys to the ansible server
+- name: "copy ceph user and bootstrap keys to the ansible server in {{ fetch_directory }}/{{ fsid }}/"
   fetch:
     src: "{{ item }}"
     dest: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
     flat: yes
+    fail_on_missing: false
   run_once: true
   with_items:
     - "{{ ceph_keys.stdout_lines }}"
@@ -26,3 +18,4 @@
     - "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring"
     - "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring"
     - "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring"
+    - "/var/lib/ceph/bootstrap-mgr/{{ cluster }}.keyring"
\ No newline at end of file