rbd: fix bug when trying to fetch key

With jewel, `bootstrap_rbd_keyring` is not set because of this condition:

```
when:
  - ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous
```

Therefore, the task `try to fetch ceph config and keys` will fail.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/2006/head
Guillaume Abrioux 2017-10-05 22:25:34 +02:00
parent 1121a840ef
commit d363b0f741
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,7 @@
set_fact:
ceph_config_keys:
- /etc/ceph/{{ cluster }}.client.admin.keyring
- "{{ bootstrap_rbd_keyring | default([]) }}"
- "{{ bootstrap_rbd_keyring | default('') }}"
- name: stat for ceph config and keys
local_action: stat path={{ fetch_directory }}/{{ fsid }}/{{ item }}
@ -19,6 +19,7 @@
failed_when: false
always_run: true
register: statconfig
when: "item | length > 0"
- name: try to fetch ceph config and keys
copy:
@ -32,6 +33,7 @@
- "{{ ceph_config_keys }}"
- "{{ statconfig.results }}"
when:
- not item.1.get('skipped')
- item.1.stat.exists == true
- name: set selinux permissions