2016-04-01 17:18:40 +08:00
|
|
|
---
|
|
|
|
- name: inspect ceph version
|
2017-01-16 23:52:20 +08:00
|
|
|
shell: docker inspect "{{ ceph_docker_registry}}/{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" | awk -F '=' '/CEPH_VERSION/ { gsub ("\",", "", $2); print $2 }' | uniq
|
2016-04-01 17:18:40 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
run_once: true
|
2016-11-27 21:16:36 +08:00
|
|
|
always_run: true
|
2016-04-01 17:18:40 +08:00
|
|
|
register: ceph_version
|
|
|
|
|
|
|
|
- set_fact:
|
2016-05-09 15:14:13 +08:00
|
|
|
after_hammer=True
|
2016-05-09 22:08:33 +08:00
|
|
|
when: ceph_version.stdout not in ['firefly','giant', 'hammer']
|
2016-04-01 17:18:40 +08:00
|
|
|
|
|
|
|
- name: create bootstrap directories (for or before hammer)
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
with_items:
|
|
|
|
- /etc/ceph/
|
|
|
|
- /var/lib/ceph/bootstrap-osd
|
|
|
|
- /var/lib/ceph/bootstrap-mds
|
|
|
|
- /var/lib/ceph/bootstrap-rgw
|
2016-05-09 15:14:13 +08:00
|
|
|
when: not after_hammer
|
2016-04-01 17:18:40 +08:00
|
|
|
|
|
|
|
- name: create bootstrap directories (after hammer)
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
2016-05-02 22:33:16 +08:00
|
|
|
owner: "64045"
|
|
|
|
group: "64045"
|
2016-04-01 17:18:40 +08:00
|
|
|
mode: "0755"
|
|
|
|
with_items:
|
|
|
|
- /etc/ceph/
|
|
|
|
- /var/lib/ceph/bootstrap-osd
|
|
|
|
- /var/lib/ceph/bootstrap-mds
|
|
|
|
- /var/lib/ceph/bootstrap-rgw
|
2016-05-09 15:14:13 +08:00
|
|
|
when: after_hammer
|