mirror of https://github.com/ceph/ceph-ansible.git
Re-arrange docker invocation and fix bootstrap
Signed-off-by: Sébastien Han <seb@redhat.com>pull/347/head
parent
8d323742c7
commit
6d0e8777e2
|
@ -114,5 +114,6 @@ osd_crush_location: "'root={{ ceph_crush_root }} rack={{ ceph_crush_rack }} host
|
||||||
#ceph_containerized_deployment: false
|
#ceph_containerized_deployment: false
|
||||||
#ceph_osd_docker_username: ceph
|
#ceph_osd_docker_username: ceph
|
||||||
#ceph_osd_docker_imagename: daemon
|
#ceph_osd_docker_imagename: daemon
|
||||||
#ceph_osd_docker_devices:
|
#ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
|
||||||
# - /dev/sdb
|
#ceph_osd_docker_device:
|
||||||
|
# - /dev/sdb
|
||||||
|
|
|
@ -109,4 +109,6 @@ osd_directory: false
|
||||||
ceph_containerized_deployment: false
|
ceph_containerized_deployment: false
|
||||||
ceph_osd_docker_username: ceph
|
ceph_osd_docker_username: ceph
|
||||||
ceph_osd_docker_imagename: daemon
|
ceph_osd_docker_imagename: daemon
|
||||||
#ceph_osd_docker_device: /dev/sdb
|
ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK" # comma separated variables
|
||||||
|
#ceph_osd_docker_device:
|
||||||
|
# - /dev/sdb
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
- name: set config and keys paths
|
||||||
|
set_fact:
|
||||||
|
ceph_config_keys:
|
||||||
|
- /etc/ceph/ceph.conf
|
||||||
|
- /var/lib/ceph/bootstrap-osd/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
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- include: pre_requisite.yml
|
||||||
|
- include: fetch_configs.yml
|
||||||
|
- include: start_docker_osd.yml
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- name: create osd bootstrap directory
|
||||||
|
file: >
|
||||||
|
path=/var/lib/ceph/bootstrap-osd
|
||||||
|
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
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- name: run the ceph osd docker image
|
||||||
|
docker: >
|
||||||
|
image="{{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
|
||||||
|
name={{ ansible_hostname }}-osd-{{ item | regex_replace('/', '') }}
|
||||||
|
net=host
|
||||||
|
state=running
|
||||||
|
privileged=yes
|
||||||
|
env="OSD_DEVICE={{ item }},{{ ceph_osd_docker_extra_env }}"
|
||||||
|
volumes="/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/dev/:/dev/"
|
||||||
|
with_items: ceph_osd_docker_devices
|
|
@ -12,5 +12,5 @@
|
||||||
- include: ./scenarios/osd_directory.yml
|
- include: ./scenarios/osd_directory.yml
|
||||||
when: osd_directory and not ceph_containerized_deployment
|
when: osd_directory and not ceph_containerized_deployment
|
||||||
|
|
||||||
- include: ./scenarios/docker.yml
|
- include: ./docker/main.yml
|
||||||
when: ceph_containerized_deployment
|
when: ceph_containerized_deployment
|
||||||
|
|
Loading…
Reference in New Issue