Merge pull request #419 from msambol/restapi

Refactor restapi
pull/421/head
Leseb 2015-10-19 11:09:10 +02:00
commit 9cb8f85c19
4 changed files with 41 additions and 41 deletions

View File

@ -14,12 +14,12 @@
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

View File

@ -1,6 +1,6 @@
---
# 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

View File

@ -1,10 +1,10 @@
---
- 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"

View File

@ -1,28 +1,28 @@
---
- 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
@ -30,12 +30,12 @@
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