Skip to content

Commit

Permalink
adding a playbook for cloudkitty
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhan27 committed Nov 15, 2017
1 parent 22b87ce commit eb0005f
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansible-role-requirements.yml
Expand Up @@ -186,3 +186,8 @@
scm: git
src: https://github.com/ceph/ansible-ceph-osd
version: v2.2.12
- name: os_cloudkitty
scm: git
src: https://github.com/openstack/openstack-ansible-os_cloudkitty
version: stable/ocata

16 changes: 16 additions & 0 deletions etc/openstack_deploy/conf.d/cloudkitty.yml.aio
@@ -0,0 +1,16 @@
---
# 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.

cloudkitty-infra_hosts:
aio1:
ip: 172.29.236.100
5 changes: 5 additions & 0 deletions etc/openstack_deploy/user_secrets.yml
Expand Up @@ -56,6 +56,11 @@ cinder_rabbitmq_password:
## Ceph/rbd: a UUID to be used by libvirt to refer to the client.cinder user
cinder_ceph_client_uuid:

##cloudkitty options
cloudkitty_container_mysql_password:
cloudkitty_service_password:
cloudkitty_rabbitmq_password:

## Glance Options
glance_container_mysql_password:
glance_service_password:
Expand Down
5 changes: 5 additions & 0 deletions playbooks/defaults/repo_packages/openstack_services.yml
Expand Up @@ -62,6 +62,11 @@ cinder_git_install_branch: 69a79e38afbdc67f61568c0b82cf6d06ca304e56 # HEAD of "s
cinder_git_dest: "/opt/cinder_{{ cinder_git_install_branch | replace('/', '_') }}"
cinder_git_project_group: cinder_all

##Cloudkitty service
cloudkitty_git_repo: https://git.openstack.org/openstack/cloudkitty
cloudkitty_git_install_branch: stable/ocata
cloudkitty_git_dest: "/opt/cloudkitty_{{cloudkitty_git_install_branch | replace('/', '_') }}"
cloudkitty_git_project_group: cloudkitty_all

## Designate service
designate_git_repo: https://git.openstack.org/openstack/designate
Expand Down
38 changes: 38 additions & 0 deletions playbooks/inventory/env.d/cloudkitty.yml
@@ -0,0 +1,38 @@
---
# 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.

component_skel:
cloudkitty_api:
belongs_to:
- cloudkitty_all
cloudkitty-processor:
belongs_to:
- cloudkitty_all

container_skel:
cloudkitty_container:
belongs_to:
- cloudkitty-infra_containers
contains:
- cloudkitty_api
- cloudkitty-processor
properties:
service_name: cloudkitty

physical_skel:
cloudkitty-infra_containers:
belongs_to:
- all_containers
cloudkitty-infra_hosts:
belongs_to:
- hosts
21 changes: 21 additions & 0 deletions playbooks/inventory/group_vars/all.yml
Expand Up @@ -177,6 +177,27 @@ cinder_rabbitmq_telemetry_host_group: "{{ cinder_rabbitmq_host_group }}"
# If there are any Ceilometer hosts in the environment, then enable its usage
cinder_ceilometer_enabled: "{{ (groups['cinder_all'] is defined) and (groups['cinder_all'] | length > 0) and (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"

## cloudkitty
# RPC
cloudkitty_rabbitmq_userid: cloudkitty
cloudkitty_rabbitmq_vhost: /cloudkitty
cloudkitty_rabbitmq_port: "{{ rabbitmq_port }}"
cloudkitty_rabbitmq_servers: "{{ rabbitmq_servers }}"
cloudkitty_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
cloudkitty_rabbitmq_host_group: "{{ rabbitmq_host_group }}"

# Telemetry notifications
cloudkitty_rabbitmq_telemetry_userid: "{{ cloudkitty_rabbitmq_userid }}"
cloudkitty_rabbitmq_telemetry_password: "{{ cloudkitty_rabbitmq_password }}"
cloudkitty_rabbitmq_telemetry_vhost: "{{ cloudkitty_rabbitmq_vhost }}"
cloudkitty_rabbitmq_telemetry_port: "{{ cloudkitty_rabbitmq_port }}"
cloudkitty_rabbitmq_telemetry_servers: "{{ cloudkitty_rabbitmq_servers }}"
cloudkitty_rabbitmq_telemetry_use_ssl: "{{ cloudkitty_rabbitmq_use_ssl }}"
cloudkitty_rabbitmq_telemetry_host_group: "{{ cloudkitty_rabbitmq_host_group }}"

# If there are any Ceilometer hosts in the environment, then enable its usage
cloudkitty_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"

## Glance
glance_service_port: 9292
glance_service_proto: http
Expand Down
16 changes: 16 additions & 0 deletions playbooks/inventory/group_vars/cloudkitty_all.yml
@@ -0,0 +1,16 @@
---
# 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.

cloudkitty_service_region: "{{ service_region }}"
cloudkitty_service_in_ldap: "{{ service_ldap_backend_enabled }}"
cloudkitty_galera_address: "{{ galera_address }}"
83 changes: 83 additions & 0 deletions playbooks/os-cloudkitty-install.yml
@@ -0,0 +1,83 @@
---
# 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.

- name: Install cloudkitty server
hosts: cloudkitty_all
gather_facts: "{{ osa_gather_facts | default(True) }}"
user: root
pre_tasks:
- include: common-tasks/os-lxc-container-setup.yml
- include: common-tasks/rabbitmq-vhost-user.yml
static: no
vars:
user: "{{ cloudkitty_rabbitmq_userid }}"
password: "{{ cloudkitty_rabbitmq_password }}"
vhost: "{{ cloudkitty_rabbitmq_vhost }}"
_rabbitmq_host_group: "{{ cloudkitty_rabbitmq_host_group }}"
when:
- inventory_hostname == groups['cloudkitty_all'][0]
- groups[cloudkitty_rabbitmq_host_group] | length > 0
- include: common-tasks/rabbitmq-vhost-user.yml
static: no
vars:
user: "{{ cloudkitty_rabbitmq_telemetry_userid }}"
password: "{{ cloudkitty_rabbitmq_telemetry_password }}"
vhost: "{{ cloudkitty_rabbitmq_telemetry_vhost }}"
_rabbitmq_host_group: "{{ cloudkitty_rabbitmq_telemetry_host_group }}"
when:
- cloudkitty_ceilometer_enabled | bool
- inventory_hostname == groups['cloudkitty_all'][0]
- groups[cloudkitty_rabbitmq_telemetry_host_group] is defined
- groups[cloudkitty_rabbitmq_telemetry_host_group] | length > 0
- groups[cloudkitty_rabbitmq_telemetry_host_group] != groups[cloudkitty_rabbitmq_host_group]
- include: common-tasks/os-log-dir-setup.yml
vars:
log_dirs:
- src: "/openstack/log/{{ inventory_hostname }}-cloudkitty"
dest: "/var/log/cloudkitty"
- include: common-tasks/mysql-db-user.yml
static: no
vars:
user_name: "{{ cloudkitty_galera_user }}"
password: "{{ cloudkitty_container_mysql_password }}"
login_host: "{{ cloudkitty_galera_address }}"
db_name: "{{ cloudkitty_galera_database }}"
when: inventory_hostname == groups['cloudkitty_all'][0]
- include: common-tasks/package-cache-proxy.yml
roles:
- role: "os_cloudkitty"
cloudkitty_venv_tag: "{{ openstack_release }}"
cloudkitty_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}-16.04-x86_64/cloudkitty-{{ openstack_release }}-x86_64.tgz"
cloudkitty_galera_address: "{{ galera_address }}"
tags:
- "os-cloudkitty"
- role: "openstack_openrc"
tags:
- openrc
- role: "rsyslog_client"
rsyslog_client_log_rotate_file: cloudkitty_log_rotate
rsyslog_client_log_dir: "/var/log/cloudkitty"
rsyslog_client_config_name: "99-cloudkitty-rsyslog-client.conf"
tags:
- rsyslog
vars:
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
cloudkitty_rabbitmq_userid: cloudkitty
cloudkitty_rabbitmq_vhost: /cloudkitty
cloudkitty_rabbitmq_servers: "{{ rabbitmq_servers }}"
cloudkitty_rabbitmq_port: "{{ rabbitmq_port }}"
cloudkitty_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- cloudkitty
1 change: 1 addition & 0 deletions playbooks/setup-openstack.yml
Expand Up @@ -37,6 +37,7 @@
- include: os-magnum-install.yml
- include: os-trove-install.yml
- include: os-sahara-install.yml
- include: os-cloudkitty-install.yml
- include: os-tempest-install.yml
when: (tempest_install | default(False)) | bool or (tempest_run | default(False)) | bool

11 changes: 11 additions & 0 deletions playbooks/vars/configs/haproxy_config.yml
Expand Up @@ -172,6 +172,17 @@ haproxy_default_services:
haproxy_balance_type: http
haproxy_backend_options:
- "httpchk HEAD /"
- service:
haproxy_service_name: cloudkitty_api
haproxy_backend_nodes: "{{ groups['cloudkitty_api'] | default([]) }}"
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_port: 8089
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"

- service:
haproxy_service_name: horizon
haproxy_backend_nodes: "{{ groups['horizon_all'] | default([]) }}"
Expand Down

0 comments on commit eb0005f

Please sign in to comment.