]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Make acls and mode parameters of opentack_keys optional 2110/head
authorJohn Fulton <fulton@redhat.com>
Wed, 25 Oct 2017 23:46:02 +0000 (23:46 +0000)
committerJohn Fulton <fulton@redhat.com>
Thu, 26 Oct 2017 12:45:17 +0000 (12:45 +0000)
Only chmod or setfacl the requested keyring(s) in the
opentack_keys data structure when the mode or acls keys
of that data structure exist.

User may specify four permission combinations for the
keyring file(s): 1. only set ACL, 2. only set mode,
3. set neither mode nor ACL, 4. set mode and then ACL.

Fixes: #2092
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-mon/tasks/openstack_config.yml

index dc6b88286736eaff5702d251424d7ed5b9518699..96d64c5130051b534ca992aac82d7824a146ba6c 100644 (file)
     docker_exec_client_cmd:
   when: docker_exec_client_cmd == 'ceph'
 
+- name: chmod key(s)
+  file:
+    path: "/etc/ceph/{{ cluster }}.{{ item.name }}.keyring"
+    mode: "{{ item.mode|default(omit) }}" # if mode not in list, uses mode from ps umask
+  with_items: "{{ keys }}"
+  when:
+    - cephx
+    - keys | length > 0
+
 - name: setfacl for key(s)
   acl:
     path: "/etc/ceph/{{ cluster }}.{{ item.0.name }}.keyring"
   when:
     - cephx
     - keys | length > 0
-
-- name: chmod key(s)
-  file:
-    path: "/etc/ceph/{{ cluster }}.{{ item.name }}.keyring"
-    mode: "{{ item.mode }}"
-  with_items: "{{ keys }}"
-  when:
-    - cephx
-    - keys | length > 0
index a9ac748b2ccc1dc8708cbf4c236bc86c3153332a..f99d80b76a4f4b0623646297e8905fdbcf69dc36 100644 (file)
     - openstack_config
     - item.0 != groups[mon_group_name] | last
 
+- name: chmod openstack key(s)
+  file:
+    path: "/etc/ceph/{{ cluster }}.{{ item.name }}.keyring"
+    mode: "{{ item.mode|default(omit) }}" # if mode not in list, uses mode from ps umask
+  with_items: "{{ openstack_keys }}"
+  when:
+    - openstack_config
+    - cephx
+    
 - name: setfacl for openstack key(s)
   acl:
     path: "/etc/ceph/{{ cluster }}.{{ item.0.name }}.keyring"
   when:
     - openstack_config
     - cephx
-
-- name: chmod openstack key(s)
-  file:
-    path: "/etc/ceph/{{ cluster }}.{{ item.name }}.keyring"
-    mode: "{{ item.mode }}"
-  with_items: "{{ openstack_keys }}"
-  when:
-    - openstack_config
-    - cephx