register: statconfig
- name: try to fetch ceph config and keys
- copy: >
- src={{ fetch_directory }}/docker_mon_files/{{ item.0 }}
- dest={{ item.0 }}
- owner=root
- group=root
- mode=644
+ copy:
+ src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
+ dest: "{{ item.0 }}"
+ owner: root
+ group: root
+ mode: 644
changed_when: false
with_together:
- ceph_config_keys
---
# 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
+ pip:
+ name: docker-py
+ version: 1.1.0
---
- 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"
+ 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"
---
- name: create ceph rest api directory
- file: >
- path=/var/lib/ceph/restapi/ceph-restapi
- state=directory
- owner=root
- group=root
- mode=0755
+ file:
+ path: /var/lib/ceph/restapi/ceph-restapi
+ state: directory
+ owner: root
+ group: root
+ mode: 0755
- name: copy ceph rest api keyring
- copy: >
- src={{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring
- dest=/var/lib/ceph/restapi/ceph-restapi/keyring
- owner=root
- group=root
- mode=600
+ copy:
+ src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring"
+ dest: "/var/lib/ceph/restapi/ceph-restapi/keyring"
+ owner: root
+ group: root
+ mode: 600
when: cephx
- name: activate ceph rest api with upstart
- file: >
- path=/var/lib/ceph/restapi/{{ item }}
- state=touch
- owner=root
- group=root
- mode=0600
+ file:
+ path: /var/lib/ceph/restapi/{{ item }}
+ state: touch
+ owner: root
+ group: root
+ mode: 0600
with_items:
- done
- upstart
when: ansible_distribution == "Ubuntu"
- name: activate ceph rest api with sysvinit
- file: >
- path=/var/lib/ceph/restapi/{{ item }}
- state=touch
- owner=root
- group=root
- mode=0600
+ file:
+ path: /var/lib/ceph/restapi/{{ item }}
+ state: touch
+ owner: root
+ group: root
+ mode: 0600
with_items:
- done
- sysvinit