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 register: statconfig
- name: try to fetch ceph config and keys - name: try to fetch ceph config and keys
copy: > copy:
src={{ fetch_directory }}/docker_mon_files/{{ item.0 }} src: "{{ fetch_directory }}/docker_mon_files/{{ item.0 }}"
dest={{ item.0 }} dest: "{{ item.0 }}"
owner=root owner: root
group=root group: root
mode=644 mode: 644
changed_when: false changed_when: false
with_together: with_together:
- ceph_config_keys - 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 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
- name: install docker-py - name: install docker-py
pip: > pip:
name=docker-py name: docker-py
version=1.1.0 version: 1.1.0

View File

@ -1,10 +1,10 @@
--- ---
- name: run the ceph rest api docker image - name: run the ceph rest api docker image
docker: > docker:
image="{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}" image: "{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}"
name={{ ansible_hostname }}-ceph-restapi name: "{{ ansible_hostname }}-ceph-restapi"
net=host net: host
expose={{ ceph_restapi_port }} expose: "{{ ceph_restapi_port }}"
state=running state: running
env="RESTAPI_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_restapi_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=RESTAPI,{{ ceph_restapi_docker_extra_env }}" 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" volumes: "/etc/ceph:/etc/ceph"

View File

@ -1,28 +1,28 @@
--- ---
- name: create ceph rest api directory - name: create ceph rest api directory
file: > file:
path=/var/lib/ceph/restapi/ceph-restapi path: /var/lib/ceph/restapi/ceph-restapi
state=directory state: directory
owner=root owner: root
group=root group: root
mode=0755 mode: 0755
- name: copy ceph rest api keyring - name: copy ceph rest api keyring
copy: > copy:
src={{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring"
dest=/var/lib/ceph/restapi/ceph-restapi/keyring dest: "/var/lib/ceph/restapi/ceph-restapi/keyring"
owner=root owner: root
group=root group: root
mode=600 mode: 600
when: cephx when: cephx
- name: activate ceph rest api with upstart - name: activate ceph rest api with upstart
file: > file:
path=/var/lib/ceph/restapi/{{ item }} path: /var/lib/ceph/restapi/{{ item }}
state=touch state: touch
owner=root owner: root
group=root group: root
mode=0600 mode: 0600
with_items: with_items:
- done - done
- upstart - upstart
@ -30,12 +30,12 @@
when: ansible_distribution == "Ubuntu" when: ansible_distribution == "Ubuntu"
- name: activate ceph rest api with sysvinit - name: activate ceph rest api with sysvinit
file: > file:
path=/var/lib/ceph/restapi/{{ item }} path: /var/lib/ceph/restapi/{{ item }}
state=touch state: touch
owner=root owner: root
group=root group: root
mode=0600 mode: 0600
with_items: with_items:
- done - done
- sysvinit - sysvinit