2015-10-21 08:12:43 +08:00
|
|
|
---
|
2017-08-11 20:31:55 +08:00
|
|
|
- name: register rbd bootstrap key
|
|
|
|
set_fact:
|
|
|
|
bootstrap_rbd_keyring: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring"
|
|
|
|
when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous
|
|
|
|
|
2015-10-21 08:12:43 +08:00
|
|
|
- name: set config and keys paths
|
|
|
|
set_fact:
|
|
|
|
ceph_config_keys:
|
2017-06-23 22:05:35 +08:00
|
|
|
- "{{ ceph_conf_key_directory }}/{{ cluster }}.client.admin.keyring"
|
|
|
|
- "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
|
|
|
|
- "{{ ceph_conf_key_directory }}/monmap-{{ cluster }}"
|
|
|
|
- "{{ ceph_conf_key_directory }}/{{ cluster }}.mon.keyring"
|
2016-08-23 18:03:05 +08:00
|
|
|
- /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
|
2017-08-11 20:31:55 +08:00
|
|
|
- "{{ bootstrap_rbd_keyring | default([]) }}"
|
2015-10-21 08:12:43 +08:00
|
|
|
|
|
|
|
- name: stat for ceph config and keys
|
|
|
|
stat:
|
2015-10-21 08:18:48 +08:00
|
|
|
path: "{{ item }}"
|
2016-11-03 17:16:33 +08:00
|
|
|
with_items: "{{ ceph_config_keys }}"
|
2015-10-21 08:12:43 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-11-27 03:52:24 +08:00
|
|
|
always_run: true
|
2015-10-21 08:12:43 +08:00
|
|
|
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:
|
2016-11-03 17:16:33 +08:00
|
|
|
- "{{ ceph_config_keys }}"
|
|
|
|
- "{{ statleftover.results }}"
|
2015-10-21 08:12:43 +08:00
|
|
|
when: item.1.stat.exists == true
|