Skip to content

Commit

Permalink
Plugin for adding CEPH REST APIs
Browse files Browse the repository at this point in the history
Change-Id: I73dc3439d42c8e108b4f22a0acec7a9166192f4b
  • Loading branch information
9seconds committed Apr 5, 2017
1 parent 1591966 commit f31066e
Show file tree
Hide file tree
Showing 21 changed files with 442 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ radosgw:
user_shards: 1
static_website: false
dns_s3website_name: your.subdomain.tld

restapi_port: 5000
1 change: 1 addition & 0 deletions backend/common/decapod_common/playbook_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def get_ceph_ansible_common_settings(cls, cluster, servers, *,
"radosgw_dns_s3website_name": config["radosgw"]["dns_s3website_name"], # NOQA
"ceph_version_verify_packagename": config["ceph_version_verify_packagename"], # NOQA
"ceph_version_verify": verify_ceph_version,
"ceph_restapi_port": config["restapi_port"],
"journal_size": config["journal"]["size"]
}
result["ceph_stable_release_uca"] = result["ceph_stable_distro_source"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=Ceph Rest Api
After=network-online.target local-fs.target time-sync.target
Wants=network-online.target local-fs.target time-sync.target
PartOf=ceph.target

[Service]
LimitNOFILE=1048576
LimitNPROC=1048576
EnvironmentFile=-/etc/default/ceph
ExecStart=/usr/bin/ceph-rest-api
PrivateDevices=yes
ProtectHome=true
ProtectSystem=full
PrivateTmp=true
TasksMax=infinity
Restart=on-failure
StartLimitInterval=30s
StartLimitBurst=5

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions backend/common/decapod_common/playbooks/init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
decapod_path_tasks: "{{ decapod_common_playbooks }}/tasks"
decapod_path_plays: "{{ decapod_common_playbooks }}/plays"
decapod_path_facts: "{{ decapod_common_playbooks }}/facts"
decapod_path_files: "{{ decapod_common_playbooks }}/files"

- name: Include Decapod vars
include_vars:
Expand Down
50 changes: 50 additions & 0 deletions backend/common/decapod_common/playbooks/plays/deploy_restapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# Copyright (c) 2017 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.


- include: "{{ decapod_common_playbooks }}/plays/add_ceph_ansible_role.yaml"

- hosts: restapis
become: true
roles:
- ceph-restapi

- hosts: restapis
become: true
tasks:
- name: Create dependencied directory for ceph-target
file:
path: /etc/systemd/system/ceph.target.wants
state: directory

- name: Upload service file
copy:
src: "{{ decapod_path_files }}/ceph-rest-api.service"
dest: /lib/systemd/system/ceph-rest-api.service

- name: Add rest-api to ceph-target.wants
file:
src: /lib/systemd/system/ceph-rest-api.service
dest: /etc/systemd/system/ceph.target.wants/ceph-rest-api.service
state: link

- name: Enable ceph-rest-api target
systemd:
daemon_reload: yes
enabled: yes
name: ceph-rest-api.service

- include: "{{ decapod_common_playbooks }}/tasks/restart_rest_api.yaml"
3 changes: 3 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
- ./plugins/playbook/cinder_integration/decapod_plugin_playbook_cinder_integration:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_cinder_integration:ro
- ./plugins/playbook/deploy_cluster/decapod_plugin_playbook_deploy_cluster:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_deploy_cluster:ro
Expand All @@ -56,6 +57,7 @@ services:
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
- ./plugins/playbook/cinder_integration/decapod_plugin_playbook_cinder_integration:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_cinder_integration:ro
- ./plugins/playbook/deploy_cluster/decapod_plugin_playbook_deploy_cluster:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_deploy_cluster:ro
Expand All @@ -79,6 +81,7 @@ services:
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
- ./plugins/playbook/cinder_integration/decapod_plugin_playbook_cinder_integration:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_cinder_integration:ro
- ./plugins/playbook/deploy_cluster/decapod_plugin_playbook_deploy_cluster:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_deploy_cluster:ro
Expand Down
1 change: 1 addition & 0 deletions docs/source/playbook-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The section contains the following topics:
playbook-plugins/plugin-remove-monitor.rst
playbook-plugins/plugin-add-rgw.rst
playbook-plugins/plugin-remove-rgw.rst
playbook-plugins/plugin-add-restapi.rst
playbook-plugins/plugin-purge-cluster.rst
playbook-plugins/plugin-telegraf-integration.rst
playbook-plugins/plugin-purge-telegraf.rst
Expand Down
102 changes: 102 additions & 0 deletions docs/source/playbook-plugins/add-restapi/example-config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. _plugin_add_restapi_example_config:

=====================
Configuration example
=====================

The following is an example of the *Add Ceph REST API host* plugin
configuration:

.. code-block:: json
{
"global_vars": {
"ceph_restapi_port": 5000,
"ceph_stable": true,
"ceph_stable_distro_source": "jewel-xenial",
"ceph_stable_release": "jewel",
"ceph_stable_release_uca": "jewel-xenial",
"ceph_stable_repo": "http://mirror.fuel-infra.org/decapod/ceph/jewel-xenial",
"ceph_stable_repo_key": "AF94F6A6A254F5F0",
"ceph_stable_repo_keyserver": "hkp://keyserver.ubuntu.com:80",
"ceph_version_verify": true,
"ceph_version_verify_packagename": "ceph-common",
"cluster": "ceph",
"cluster_network": "10.0.0.0/24",
"copy_admin_key": true,
"dmcrypt_dedicated_journal": false,
"dmcrypt_journal_collocation": false,
"fsid": "84965b5f-ce7d-4c88-a7ea-1b9b82c15d4e",
"journal_collocation": true,
"journal_size": 512,
"max_open_files": 131072,
"nfs_file_gw": false,
"nfs_obj_gw": false,
"os_tuning_params": [
{
"name": "fs.file-max",
"value": 26234859
},
{
"name": "kernel.pid_max",
"value": 4194303
}
],
"public_network": "10.0.0.0/24",
"radosgw_civetweb_num_threads": 50,
"radosgw_civetweb_port": 8080,
"radosgw_dns_s3website_name": "your.subdomain.tld",
"radosgw_static_website": false,
"radosgw_usage_log": false,
"radosgw_usage_log_flush_threshold": 1024,
"radosgw_usage_log_tick_interval": 30,
"radosgw_usage_max_shards": 32,
"radosgw_usage_max_user_shards": 1,
"raw_multi_journal": false
},
"inventory": {
"_meta": {
"hostvars": {
"10.0.0.20": {
"ansible_user": "ansible",
"devices": [
"/dev/sda",
"/dev/sdb",
"/dev/sdc"
],
"monitor_address": "10.0.0.20"
},
"10.0.0.21": {
"ansible_user": "ansible",
"devices": [
"/dev/sda",
"/dev/sdb",
"/dev/sdc"
],
"monitor_address": "10.0.0.21"
},
"10.0.0.22": {
"ansible_user": "ansible",
"devices": [
"/dev/sda",
"/dev/sdb",
"/dev/sdc"
],
"monitor_address": "10.0.0.22"
}
}
},
"already_deployed": [
"10.0.0.21",
"10.0.0.20",
"10.0.0.22"
],
"mons": [
"10.0.0.20",
"10.0.0.21"
],
"restapis": [
"10.0.0.22"
]
}
}
26 changes: 26 additions & 0 deletions docs/source/playbook-plugins/add-restapi/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _plugin_add_restapi_overview:

========
Overview
========

The following table shows the general information about the *Add Ceph
REST API Gateway host* plugin:

==================== ======================
Property Value
==================== ======================
ID add_restapi
Name Add Ceph REST API host
Required Server List Yes
==================== ======================

Plugin is tightly coupled with ``ceph-ansible`` versions. The following
table shows the mapping between the plugin version and the corresponding
version of ``ceph-ansible``.

============== ============================================================
Plugin version ``ceph-ansible`` version
============== ============================================================
1.1 `v2.1.9 <https://github.com/ceph/ceph-ansible/tree/v2.1.9>`_
============== ============================================================
16 changes: 16 additions & 0 deletions docs/source/playbook-plugins/plugin-add-restapi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _plugins_add_restapi:

======================
Add Ceph REST API host
======================

The *Add Ceph REST API host* playbook plugin allows you to add a
new host with REST API to the cluster.

The section contains the following topics:

.. toctree::
:maxdepth: 1

add-restapi/overview.rst
add-restapi/example-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
- include: "{{ decapod_common_playbooks }}/plays/add_ceph_ansible_role.yaml"

- hosts: osds
become: True
become: true
roles:
- ceph-osd
2 changes: 2 additions & 0 deletions plugins/playbook/add_restapi/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include decapod_plugin_playbook_add_restapi/config.yaml
include decapod_plugin_playbook_add_restapi/playbook.yaml
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.


- include: "{{ decapod_common_playbooks }}/plays/deploy_restapi.yaml"

0 comments on commit f31066e

Please sign in to comment.