Set default value for osds/osd_ids facts when facts not set

Change-Id: I8754de1ef89ac05cd8817456c4a8496ad71cf293
Closes-bug: #1668275
This commit is contained in:
Christian Berendt 2017-02-27 15:13:15 +01:00
parent 225b1a1dbb
commit 1b15dc24a4

View File

@ -25,7 +25,7 @@
- name: Gathering OSD IDs
command: "cat /var/lib/ceph/osd/{{ item['fs_uuid'] }}/whoami"
with_items: "{{ osds }}"
with_items: "{{ osds|default({}) }}"
register: osd_ids
changed_when: False
failed_when: osd_ids.rc != 0
@ -38,7 +38,7 @@
register: ceph_osd_container_state
failed_when: ceph_osd_container_state.Running == false
when: inventory_hostname in groups['ceph-osd']
with_items: "{{ osd_ids.results }}"
with_items: "{{ osd_ids.results|default({}) }}"
- name: Ensuring the ceph_rgw container is up
kolla_docker:
@ -68,7 +68,7 @@
changed_when: false
failed_when: false
register: ceph_osd_check_results
with_items: "{{ osd_ids.results }}"
with_items: "{{ osd_ids.results|default({}) }}"
when: inventory_hostname in groups['ceph-osd']
- name: Check the configs in ceph_rgw container
@ -96,7 +96,7 @@
name: "ceph_osd_{{ item.stdout }}"
action: "get_container_env"
register: ceph_osd_container_envs
with_items: "{{ osd_ids.results }}"
with_items: "{{ osd_ids.results|default({}) }}"
when:
- inventory_hostname in groups['ceph-osd']
- osds
@ -137,7 +137,7 @@
- item[2]['rc'] == 1
- osds
with_together:
- "{{ osd_ids.results }}"
- "{{ osd_ids.results|default({}) }}"
- "{{ ceph_osd_container_envs.results }}"
- "{{ ceph_osd_check_results.results }}"
@ -195,7 +195,7 @@
- item[2]['rc'] == 1
- osds
with_together:
- "{{ osd_ids.results }}"
- "{{ osd_ids.results|default({}) }}"
- "{{ ceph_osd_container_envs.results }}"
- "{{ ceph_osd_check_results.results }}"