#ceph_restapi_port: 5000
#ceph_restapi_docker_username: ceph
#ceph_restapi_docker_imagename: daemon
+#ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables
ceph_restapi_port: 5000
ceph_restapi_docker_username: ceph
ceph_restapi_docker_imagename: daemon
+ceph_restapi_docker_extra_env: "RESTAPI_IP=0.0.0.0" # comma separated variables
+++ /dev/null
----
-- name: set config and keys paths
- set_fact:
- ceph_config_keys:
- - /etc/ceph/ceph.client.admin.keyring
- - /etc/ceph/ceph.conf
-
-# 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 rest api docker image
- docker: >
- image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}"
- name={{ ansible_hostname }}-ceph-restapi
- net=host
- expose={{ ceph_restapi_port }}
- state=running
- env="RESTAPI_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_restapi_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=RESTAPI"
- volumes="/etc/ceph:/etc/ceph"
-
-- name: ensure ceph rest api service is running
- docker: >
- image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}"
- name="ceph-{{ ansible_hostname }}"
- ports={{ ceph_restapi_port }}:{{ ceph_restapi_port }}
- detach=yes
- state=running
--- /dev/null
+---
+- name: set config and keys paths
+ set_fact:
+ ceph_config_keys:
+ - /etc/ceph/ceph.conf
+ - /etc/ceph/ceph.client.admin.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
--- /dev/null
+---
+- include: pre_requisite.yml
+- include: fetch_configs.yml
+- include: start_docker_restapi.yml
--- /dev/null
+---
+# 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
--- /dev/null
+---
+- name: run the ceph rest api docker image
+ docker: >
+ image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}"
+ name={{ ansible_hostname }}-ceph-restapi
+ net=host
+ expose={{ ceph_restapi_port }}
+ state=running
+ env="RESTAPI_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_restapi_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=RESTAPI,{{ ceph_restapi_docker_extra_env }}"
+ volumes="/etc/ceph:/etc/ceph"
- include: start_restapi.yml
when: not ceph_containerized_deployment
-- include: docker.yml
+- include: ./docker/main.yml
when: ceph_containerized_deployment