]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-: abitlity to copy admin on all the nodes
authorSébastien Han <seb@redhat.com>
Thu, 25 Feb 2016 11:04:17 +0000 (12:04 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 25 Feb 2016 11:04:17 +0000 (12:04 +0100)
This commit allows you to set a new variable to 'true' if you want to
have ceph admin key copied over different kind of hosts such as MDS,
OSD, RGW. To enable this just set `copy_admin_key` to true.

Closes: #555
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-mds/defaults/main.yml
roles/ceph-mds/tasks/pre_requisite.yml
roles/ceph-osd/defaults/main.yml
roles/ceph-osd/tasks/pre_requisite.yml
roles/ceph-rgw/defaults/main.yml
roles/ceph-rgw/tasks/pre_requisite.yml

index 1bedb16e071ae2ba065f1909ad6b60a38641a3d3..59689c171c68bab6563d17951e8cf34ba34ec14d 100644 (file)
@@ -7,6 +7,12 @@
 \r
 fetch_directory: fetch/\r
 \r
+# Even though MDS nodes should not have the admin key\r
+# at their disposal, some people might want to have it\r
+# distributed on MDS nodes. Setting 'copy_admin_key' to 'true'\r
+# will copy the admin key to the /etc/ceph/ directory\r
+copy_admin_key: false\r
+\r
 cephx: true\r
 \r
 \r
index 9481bbb552fd405c1bfbb2e63a0f1575f028e410..966e458726af7dbcfee5d75a1789a03273bbe628 100644 (file)
@@ -9,11 +9,17 @@
 
 - name: copy mds bootstrap key
   copy:
-    src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-mds/ceph.keyring"
-    dest: /var/lib/ceph/bootstrap-mds/ceph.keyring
+    src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
+    dest: "{{ item }}"
     owner: "{{ key_owner }}"
     group: "{{ key_group }}"
     mode: "{{ key_mode }}"
+  with_items:
+    - { name: /var/lib/ceph/bootstrap-mds/ceph.keyring, copy: true }
+    - { name: /etc/ceph/client.admin.keyring, "{{ copy_admin_key }}" }
+  when:
+    cephx and
+    item.copy is true
 
 - name: create mds directory
   file:
index 7fbcece14c0c4eef28fa5c8fe5671fa728e8fd3c..a609e7c9c7bed7df65cfe7d0d3a8f2dd6233910d 100644 (file)
@@ -8,6 +8,12 @@
 \r
 fetch_directory: fetch/\r
 \r
+# Even though OSD nodes should not have the admin key\r
+# at their disposal, some people might want to have it\r
+# distributed on OSD nodes. Setting 'copy_admin_key' to 'true'\r
+# will copy the admin key to the /etc/ceph/ directory\r
+copy_admin_key: false\r
+\r
 ####################\r
 # OSD CRUSH LOCATION\r
 ####################\r
index cd0fd7424a60dfa0ef79385002c3d6c6d5147472..12fe9a5717487495ecf26e2661873898a686d1fb 100644 (file)
 
 - name: copy osd bootstrap key
   copy:
-    src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-osd/ceph.keyring"
-    dest: /var/lib/ceph/bootstrap-osd/ceph.keyring
+    src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
+    dest: "{{ item }}"
     owner: "{{ key_owner }}"
     group: "{{ key_group }}"
     mode: "{{ key_mode }}"
+  with_items:
+    - { name: /var/lib/ceph/bootstrap-osd/ceph.keyring, copy: true }
+    - { name: /etc/ceph/client.admin.keyring, "{{ copy_admin_key }}" }
   when:
-    cephx
+    cephx and
+    item.copy is true
index cee4bf9b627cc0e511848fa59efe364d80f3570f..e5b8350f300aa08748db1a7b36f0cf1b7a870cb7 100644 (file)
@@ -7,6 +7,12 @@
 \r
 fetch_directory: fetch/\r
 \r
+# Even though RGW nodes should not have the admin key\r
+# at their disposal, some people might want to have it\r
+# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'\r
+# will copy the admin key to the /etc/ceph/ directory\r
+copy_admin_key: false\r
+\r
 ## Ceph options\r
 #\r
 cephx: true\r
index 2e9dda9db942dd4107483c3a3734039dba884adf..a546774f6549ce7a7c7acdbf66ab2cf176d48d0a 100644 (file)
 
 - name: copy rados gateway bootstrap key
   copy:
-    src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring"
-    dest: /var/lib/ceph/bootstrap-rgw/ceph.keyring
+    src: "{{ fetch_directory }}/{{ fsid }}{{ item.name }}"
+    dest: "{{ item }}"
     owner: "{{ key_owner }}"
     group: "{{ key_group }}"
     mode: "{{ key_mode }}"
-  when: cephx
+  with_items:
+    - { name: /var/lib/ceph/bootstrap-rgw/ceph.keyring, copy: true }
+    - { name: /etc/ceph/client.admin.keyring, "{{ copy_admin_key }}" }
+  when:
+    cephx and
+    item.copy is true
 
 - name: create rados gateway keyring
   command: ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring