Now the Ceph REST API can be deployed.
Default implementation deploys it on the same nodes as the monitors
which should be fine.
Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
#radosgw: false # referenced in monitor role too.
#radosgw_dns_name: your.subdomain.tld # subdomains used by radosgw. See http://ceph.com/docs/master/radosgw/config/#enabling-subdomain-s3-calls
+## REST API options
+#
+#restapi: false # disable restapi configuration in ceph.conf
+#restapi_public_addr: 0.0.0.0:5000
+#restapi_base_url: /api/v0.1
+#restapi_log_level: warning
+
## Testing mode
# enable this mode _only_ when you have a single node
# if you don't want it keep the option commented
radosgw_frontend: civetweb # supported options are 'apache' or 'civetweb', also edit roles/ceph-radosgw/defaults/main.yml\r
radosgw_civetweb_port: 80\r
\r
+## REST API options\r
+#\r
+restapi: false # disable restapi configuration in ceph.conf\r
+restapi_interface: eth1\r
+restapi_port: 5000\r
+restapi_base_url: /api/v0.1\r
+restapi_log_level: warning # available level are: critical, error, warning, info, debug\r
+\r
## Testing mode\r
# enable this mode _only_ when you have a single node\r
# if you don't want it keep the option commented\r
{% endif %}
{% endfor %}
{% endif %}
+
+{% if restapi %}
+[client.restapi]
+ public addr = {{ hostvars[inventory_hostname]['ansible_' + restapi_interface]['ipv4']['address'] }}:{{ restapi_port }}
+ restapi base url = {{ restapi_base_url }}
+ restapi log level = {{ restapi_log_level }}
+ keyring = /var/lib/ceph/restapi/ceph-restapi/keyring
+ log file = /var/log/ceph/ceph-restapi.log
+{% endif %}
cephfs_metadata: cephfs_metadata\r
cephfs: cephfs\r
\r
+# Ceph REST API\r
+# referenced in common role too.\r
+restapi: false\r
+\r
+\r
#############\r
# OPENSTACK #\r
#############\r
with_items: groups.rgws
changed_when: False
+- name: Create Ceph REST API keyring
+ command: >
+ ceph auth get-or-create client.restapi osd 'allow *' mon 'allow *' -o /etc/ceph/ceph.client.restapi.keyring
+ creates=/etc/ceph/ceph.client.restapi.keyring
+ when: cephx and restapi
+ changed_when: False
+
- include: openstack_config.yml
when: openstack_config and cephx
register: ceph_keys
when: cephx
+- name: Set keys permissions
+ file: >
+ path={{ item }}
+ mode=0600
+ owner=root
+ group=root
+ with_items:
+ - "{{ ceph_keys.stdout_lines }}"
+
- name: Copy keys to the ansible server
fetch: >
src={{ item }}
--- /dev/null
+---
+- include: pre_requisite.yml
+
+- name: Check if Ceph REST API is already started
+ shell: "ps aux|grep [c]eph-rest-api"
+ register: restapi_status
+ ignore_errors: True
+
+- name: Start Ceph REST API
+ shell: "nohup ceph-rest-api -n client.restapi &"
+ when: restapi_status.rc != 0
--- /dev/null
+---
+- name: Create Ceph REST API directory
+ file: >
+ path=/var/lib/ceph/restapi/ceph-restapi
+ state=directory
+ owner=root
+ group=root
+ mode=0644
+
+- name: Copy Ceph REST API keyring
+ copy: >
+ src=fetch/{{ 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/ceph-restapi/done
+ state=touch
+ owner=root
+ group=root
+ mode=0644
sudo: True
roles:
- ceph-mon
+ - ceph-restapi
- hosts: osds
sudo: True