2015-07-28 21:44:52 +08:00
|
|
|
---
|
2016-01-22 01:22:46 +08:00
|
|
|
- name: set config and keys paths
|
|
|
|
set_fact:
|
|
|
|
ceph_bootstrap_config_keys:
|
|
|
|
- /etc/ceph/ceph.conf
|
|
|
|
- /var/lib/ceph/bootstrap-osd/ceph.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-rgw/ceph.keyring
|
|
|
|
- /var/lib/ceph/bootstrap-mds/ceph.keyring
|
|
|
|
|
2016-01-14 03:15:35 +08:00
|
|
|
- name: pull ceph daemon image
|
|
|
|
shell: "docker pull {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
|
|
|
|
|
2015-07-28 21:44:52 +08:00
|
|
|
- name: run the ceph Monitor docker image
|
2015-10-17 07:55:31 +08:00
|
|
|
docker:
|
|
|
|
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
|
|
|
|
name: "{{ ansible_hostname }}"
|
|
|
|
net: "host"
|
|
|
|
state: "running"
|
|
|
|
env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
|
|
|
|
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
|
2016-01-14 03:15:35 +08:00
|
|
|
|
2016-01-22 01:22:46 +08:00
|
|
|
|
|
|
|
- name: stat for ceph config and keys
|
|
|
|
stat: path="{{ item }}"
|
|
|
|
with_items: ceph_bootstrap_config_keys
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: statmonconfig
|
|
|
|
|
|
|
|
- name: fetch boostrap keys and conf from mon
|
2016-01-14 03:15:35 +08:00
|
|
|
fetch:
|
2016-01-22 01:22:46 +08:00
|
|
|
dest: "{{ playbook_dir }}/{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}"
|
|
|
|
src: "{{ item.0 }}"
|
2016-01-14 03:15:35 +08:00
|
|
|
flat: yes
|
2016-01-22 01:22:46 +08:00
|
|
|
with_together:
|
|
|
|
- ceph_bootstrap_config_keys
|
|
|
|
- statmonconfig.results
|
|
|
|
when: item.1.stat.exists == true
|
|
|
|
|
2016-01-14 03:15:35 +08:00
|
|
|
|