]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
client: add a default value for keyring file
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 7 Jun 2018 13:49:03 +0000 (15:49 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 7 Jun 2018 16:27:00 +0000 (18:27 +0200)
Potential error if someone doesnt pass the mode in `keys` dict for
client nodes:

```
fatal: [client2]: FAILED! => {}

MSG:

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'mode'

The error appears to have been in '/home/guits/ceph-ansible/roles/ceph-client/tasks/create_users_keys.yml': line 117, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: get client cephx keys
  ^ here

exception type: <class 'ansible.errors.AnsibleUndefinedVariable'>
exception: 'dict object' has no attribute 'mode'

```

adding a default value will avoid the deployment failing for this.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8a653cacd56553926126d0b43d328af94bbd0337)
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-client/tasks/create_users_keys.yml

index abb3cf0b418bb0a4fc21fe9a1bbbd122265aa62c..a0d10ce70f8d334bbbb30bbac7851f3ef17ebf03 100644 (file)
   copy:
     dest: "{{ item.source }}"
     content: "{{ item.content | b64decode }}"
-    mode: "{{ item.item.mode }}"
+    mode: "{{ item.item.get('mode', '0600') }}"
     owner: "{{ ceph_uid }}"
     group: "{{ ceph_uid }}"
   with_items: