switch: make osd collection idempotent

This commits allows us to run
switch-from-non-containerized-to-containerized-ceph-daemons.yml multiple
times.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1489353
Signed-off-by: Sébastien Han <seb@redhat.com>
pull/1873/head
Sébastien Han 2017-09-08 11:30:45 +02:00
parent cd042dfd0c
commit fdacac9fa0
1 changed files with 3 additions and 1 deletions

View File

@ -199,6 +199,7 @@
systemctl list-units | grep "loaded active" | grep -Eo 'ceph-osd@[0-9]{1,2}.service'
register: running_osds
changed_when: false
failed_when: false
- name: collect osd devices
shell: |
@ -222,7 +223,8 @@
state: stopped
enabled: no
masked: yes
with_items: "{{ running_osds.stdout_lines }}"
with_items: "{{ running_osds.stdout_lines | default([])}}"
when: running_osds != []
- set_fact:
ceph_uid: 64045