client: add a default value for keyring file

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>
pull/2736/head
Guillaume Abrioux 2018-06-07 15:49:03 +02:00
parent 5eacc8f8d8
commit 8a653cacd5
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@
copy: copy:
dest: "{{ item.source }}" dest: "{{ item.source }}"
content: "{{ item.content | b64decode }}" content: "{{ item.content | b64decode }}"
mode: "{{ item.item.mode }}" mode: "{{ item.item.get('mode', '0600') }}"
owner: "{{ ceph_uid }}" owner: "{{ ceph_uid }}"
group: "{{ ceph_uid }}" group: "{{ ceph_uid }}"
with_items: with_items: