]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Revert "client: add quotes to the dict values"
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 7 Sep 2018 14:54:42 +0000 (16:54 +0200)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Fri, 7 Sep 2018 17:21:55 +0000 (17:21 +0000)
This commit is adding quotes that make keyring unusuable

eg:

```
client.john
        key: AQAN0RdbAAAAABAAH5D3WgMN9Rxw3M8jkpMIfg==
        caps: [mds] ''
        caps: [mgr] 'allow *'
        caps: [mon] 'allow rw'
        caps: [osd] 'allow rw'
```

Trying to import such a keyring and use it will result:

```
Error EACCES: access denied
```

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1623417
This reverts commit 424815501a0c6072234a8e1311a0fefeb5bcc222.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-client/tasks/create_users_keys.yml

index 64e01d913ed8e94d844d7aa39921ae40010e846c..95ac7257731f1315db661fa21c3dcbfbc22ae2d9 100644 (file)
@@ -1,7 +1,7 @@
 ---
 - name: set_fact keys_tmp - preserve backward compatibility after the introduction of the ceph_keys module
   set_fact:
-    keys_tmp: "{{ keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap|quote, 'osd': item.osd_cap|default('')|quote, 'mds': item.mds_cap|default('')|quote, 'mgr': item.mgr_cap|default('')|quote } , 'mode': item.mode } ] }}"
+    keys_tmp: "{{ keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap, 'osd': item.osd_cap|default(''), 'mds': item.mds_cap|default(''), 'mgr': item.mgr_cap|default('') } , 'mode': item.mode } ] }}"
   when:
     - item.get('mon_cap', None) # it's enough to assume we are running an old-fashionned syntax simply by checking the presence of mon_cap since every key needs this cap
   with_items: "{{ keys }}"