Merge pull request #349 from ceph/fix-docker-mds

Re-arrange docker invocation and fix bootstrap mds
pull/350/head
Leseb 2015-07-28 17:28:26 +02:00
commit 510e2c174f
7 changed files with 56 additions and 1 deletions

View File

@ -11,3 +11,4 @@ dummy:
#ceph_containerized_deployment: false
#ceph_mds_docker_username: ceph
#ceph_mds_docker_imagename: daemon
#ceph_mds_docker_extra_envs: "MDS_NAME={{ ansible_hostname }}" # comma separated variables

View File

@ -11,3 +11,4 @@ cephx: true
ceph_containerized_deployment: false
ceph_mds_docker_username: ceph
ceph_mds_docker_imagename: daemon
ceph_mds_docker_extra_envs: "MDS_NAME={{ ansible_hostname }}" # comma separated variables

View File

@ -0,0 +1,29 @@
---
# NOTE (leseb): the mds container needs the admin key
# so it can create the mds pools for cephfs
- name: set config and keys paths
set_fact:
ceph_config_keys:
- /etc/ceph/ceph.conf
- /etc/ceph/ceph.client.admin.keyring
- /var/lib/ceph/bootstrap-mds/ceph.keyring
- name: stat for ceph config and keys
local_action: stat path={{ item }}
with_items: ceph_config_keys
changed_when: false
sudo: false
ignore_errors: true
register: statconfig
- name: try to fetch ceph config and keys
copy: >
src=fetch/docker_mon_files/{{ item.0 }}
dest={{ item.0 }}
owner=root
group=root
mode=644
with_together:
- ceph_config_keys
- statconfig.results
when: item.1.stat.exists == true

View File

@ -0,0 +1,4 @@
---
- include: pre_requisite.yml
- include: fetch_configs.yml
- include: start_docker_mds.yml

View File

@ -0,0 +1,11 @@
---
- name: create mds bootstrap directory
file: >
path=/var/lib/ceph/bootstrap-mds
state=directory
# NOTE (leseb): for 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

View File

@ -0,0 +1,9 @@
---
- 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="CEPHFS_CREATE=1,{{ ceph_osd_docker_extra_env }}"
volumes="/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"

View File

@ -2,5 +2,5 @@
- include: pre_requisite.yml
when: not ceph_containerized_deployment
- include: docker.yml
- include: ./docker/main.yml
when: ceph_containerized_deployment