2016-04-01 17:18:40 +08:00
|
|
|
---
|
|
|
|
- name: pull ceph daemon image
|
2016-04-25 05:32:17 +08:00
|
|
|
shell: "docker pull {{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
|
2016-04-01 17:18:40 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
# NOTE (leseb): we can not use docker inspect with 'format filed' because of
|
|
|
|
# https://github.com/ansible/ansible/issues/10156
|
|
|
|
- name: inspect ceph version
|
2016-04-12 18:01:53 +08:00
|
|
|
shell: docker inspect docker.io/"{{ ceph_osd_docker_username }}"/"{{ ceph_osd_docker_imagename }}" | 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
|
|
|
|
register: ceph_version
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
after_hamer=True
|
|
|
|
when:
|
|
|
|
ceph_version.stdout not in ['firefly','giant', 'hammer']
|
|
|
|
|
|
|
|
- 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
|
|
|
|
when: not after_hamer
|
|
|
|
|
|
|
|
- name: create bootstrap directories (after hammer)
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "64045"
|
|
|
|
group: "64045"
|
|
|
|
mode: "0755"
|
|
|
|
with_items:
|
|
|
|
- /etc/ceph/
|
|
|
|
- /var/lib/ceph/bootstrap-osd
|
|
|
|
when: after_hamer
|