ceph-ansible/roles/ceph-restapi/tasks/pre_requisite.yml

150 lines
4.1 KiB
YAML
Raw Normal View History

---
- name: create ceph rest api directory (for or after infernalis release)
file:
path: /var/lib/ceph/restapi/ceph-restapi
state: directory
owner: ceph
group: ceph
mode: 0755
when:
ceph_stable_release != 'dumpling' and
ceph_stable_release != 'emperor' and
ceph_stable_release != 'firefly' and
ceph_stable_release != 'giant' and
ceph_stable_release != 'hammer'
- name: create ceph rest api directory (before infernalis release)
2015-10-19 11:28:48 +08:00
file:
path: /var/lib/ceph/restapi/ceph-restapi
state: directory
owner: root
group: root
mode: 0755
when:
ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer'
- name: copy ceph rest api keyring (for or after infernalis release)
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/ceph.client.restapi.keyring"
dest: "/var/lib/ceph/restapi/ceph-restapi/keyring"
owner: ceph
group: ceph
mode: 600
when:
cephx and
(ceph_stable_release != 'dumpling' and
ceph_stable_release != 'emperor' and
ceph_stable_release != 'firefly' and
ceph_stable_release != 'giant' and
ceph_stable_release != 'hammer')
- name: copy ceph rest api keyring (before infernalis release)
2015-10-19 11:28:48 +08:00
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 and
(ceph_stable_release == 'dumpling' or
ceph_stable_release == 'emperor' or
ceph_stable_release == 'firefly' or
ceph_stable_release == 'giant' or
ceph_stable_release == 'hammer')
- name: activate ceph rest api with upstart (for or after infernalis release)
file:
path: /var/lib/ceph/restapi/{{ item }}
state: touch
owner: ceph
group: ceph
mode: 0600
with_items:
- done
- upstart
changed_when: false
when:
ansible_distribution == "Ubuntu" and
(ceph_stable_release != 'dumpling' and
ceph_stable_release != 'emperor' and
ceph_stable_release != 'firefly' and
ceph_stable_release != 'giant' and
ceph_stable_release != 'hammer')
- name: activate ceph rest api with upstart (before infernalis release)
2015-10-19 11:28:48 +08:00
file:
path: /var/lib/ceph/restapi/{{ item }}
state: touch
owner: root
group: root
mode: 0600
with_items:
- done
- upstart
changed_when: false
when:
ansible_distribution == "Ubuntu" and
(ceph_stable_release != 'dumpling' or
ceph_stable_release != 'emperor' or
ceph_stable_release != 'firefly' or
ceph_stable_release != 'giant' or
ceph_stable_release != 'hammer')
- name: activate ceph rest api with sysvinit (for or after infernalis release))
file:
path: /var/lib/ceph/restapi/{{ item }}
state: touch
owner: ceph
group: ceph
mode: 0600
with_items:
- done
- sysvinit
when:
ansible_distribution != "Ubuntu" and
(ceph_stable_release != 'dumpling' and
ceph_stable_release != 'emperor' and
ceph_stable_release != 'firefly' and
ceph_stable_release != 'giant' and
ceph_stable_release != 'hammer')
- name: activate ceph rest api with sysvinit (before infernalis release))
2015-10-19 11:28:48 +08:00
file:
path: /var/lib/ceph/restapi/{{ item }}
state: touch
owner: root
group: root
mode: 0600
with_items:
- done
- sysvinit
when:
ansible_distribution != "Ubuntu" and
(ceph_stable_release != 'dumpling' or
ceph_stable_release != 'emperor' or
ceph_stable_release != 'firefly' or
ceph_stable_release != 'giant' or
ceph_stable_release != 'hammer')
# NOTE (leseb): will uncomment this when this https://github.com/ceph/ceph/pull/4144 lands
#- name: start and add that the Ceph REST API service to the init sequence (Ubuntu)
# service: >
# name=ceph-restapi
# state=started
# enabled=yes
# args="id={{ ansible_hostname }}"
# when: ansible_distribution == "Ubuntu"
#
#- name: start and add that the Ceph REST API service to the init sequence
# service: >
# name=ceph
# state=started
# enabled=yes
# args=restapi
# when: ansible_distribution != "Ubuntu"