2016-07-12 18:15:22 +08:00
|
|
|
---
|
|
|
|
- name: set config and keys paths
|
|
|
|
set_fact:
|
|
|
|
ceph_config_keys:
|
2016-08-23 18:03:05 +08:00
|
|
|
- /etc/ceph/{{ cluster }}.client.admin.keyring
|
|
|
|
- /etc/ceph/{{ cluster }}.conf
|
|
|
|
- /etc/ceph/monmap-{{ cluster }}
|
|
|
|
- /etc/ceph/{{ cluster }}.mon.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
|
2016-07-12 18:15:22 +08:00
|
|
|
|
|
|
|
- name: stat for ceph config and keys
|
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
|
|
|
with_items: ceph_config_keys
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: statleftover
|
|
|
|
|
|
|
|
- name: fail if we find existing cluster files
|
|
|
|
fail:
|
|
|
|
msg: "looks like no cluster is running but ceph files are present, please remove them"
|
|
|
|
with_together:
|
|
|
|
- ceph_config_keys
|
|
|
|
- statleftover.results
|
|
|
|
when: item.1.stat.exists == true
|