ceph-ansible/roles/ceph-mds/tasks/docker.yml

50 lines
1.3 KiB
YAML

---
- name: set config and keys paths
set_fact:
ceph_config_keys:
- /etc/ceph/ceph.client.admin.keyring
- /etc/ceph/ceph.conf
- /etc/ceph/monmap
- /etc/ceph/ceph.mon.keyring
- /var/lib/ceph/bootstrap-mds/ceph.keyring
# NOTE (leseb): force version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
- name: install docker-py
pip: >
name=docker-py
version=1.1.0
- name: stat for ceph config and keys
stat: >
path={{ item }}
with_items: ceph_config_keys
ignore_errors: true
register: statconfig
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/"{{ item }}"
dest=/etc/ceph/
owner=root
group=root
mode=600
with_together:
- ceph_config_keys
- statconfig.results
when: item.1.stat.exists == true
- name: run the ceph medata docker image
docker: >
image="{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}"
name=ceph-{{ ansible_hostname }}-mds
net=host
state=running
env="CEPH_DAEMON=MDS,CEPHFS_CREATE=1"
volumes="/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
- name: ensure ceph_mds service is running
docker: >
image="{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}"
name="ceph-{{ ansible_hostname }}-mds"
state=running