diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index aa65f1645e..aefc10cacc 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -90,6 +90,10 @@ scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_magnum version: 3475d51c5b5f73d1cf6bc66bdfd1e8f6f7e7e5ff +- name: os_trove + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_trove + version: 252822cfc2950c54059103eeccfab1daacdda64d - name: os_neutron scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_neutron diff --git a/etc/openstack_deploy/conf.d/trove.yml.aio b/etc/openstack_deploy/conf.d/trove.yml.aio new file mode 100644 index 0000000000..97d9e29d33 --- /dev/null +++ b/etc/openstack_deploy/conf.d/trove.yml.aio @@ -0,0 +1,3 @@ +trove-infra_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/conf.d/trove.yml.example b/etc/openstack_deploy/conf.d/trove.yml.example new file mode 100644 index 0000000000..28d3538a09 --- /dev/null +++ b/etc/openstack_deploy/conf.d/trove.yml.example @@ -0,0 +1,8 @@ +# The infra nodes that will be running the trove services +trove-infra_hosts: + infra1: + ip: 172.20.236.111 + infra2: + ip: 172.20.236.112 + infra3: + ip: 172.20.236.113 diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index 670a8ca2e7..36b14a9e92 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -134,3 +134,8 @@ magnum_trustee_password: ## Rally Options: rally_galera_password: + +## Trove Options +trove_galera_password: +trove_rabbitmq_password: +trove_service_password: diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index c807721da3..28e68704ad 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -181,3 +181,9 @@ magnum_git_repo: https://git.openstack.org/openstack/magnum magnum_git_install_branch: de227ba88ccc2936bcab09905345f23b42f57964 # HEAD of "stable/newton" as of 27.09.2016 magnum_git_dest: "/opt/magnum_{{ magnum_git_install_branch | replace('/', '_') }}" magnum_git_project_group: magnum_all + +## Trove service +trove_git_repo: https://git.openstack.org/openstack/trove +trove_git_install_branch: 41f3dd6920eb60d438e1542e9994319c08e44461 # HEAD of "master" as of 02.10.2016 +trove_git_dest: "/opt/trove_{{ trove_git_install_branch | replace('/', '_') }}" +trove_git_project_group: trove_all diff --git a/playbooks/inventory/env.d/trove.yml b/playbooks/inventory/env.d/trove.yml new file mode 100644 index 0000000000..32cf0a3f21 --- /dev/null +++ b/playbooks/inventory/env.d/trove.yml @@ -0,0 +1,59 @@ +--- +# Copyright 2016 Internet Solutions (Pty) Ltd +# +# 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. +# +# (c) 2016 Donovan Francesco +# (c) 2016 Paul Stevens + +component_skel: + trove_api: + belongs_to: + - trove_all + trove_conductor: + belongs_to: + - trove_all + trove_taskmanager: + belongs_to: + - trove_all + +container_skel: + trove_api_container: + belongs_to: + - trove-infra_containers + contains: + - trove_api + properties: + service_name: trove + trove_conductor_container: + belongs_to: + - trove-infra_containers + contains: + - trove_conductor + properties: + service_name: trove + trove_taskmanager_container: + belongs_to: + - trove-infra_containers + contains: + - trove_taskmanager + properties: + service_name: trove + +physical_skel: + trove-infra_containers: + belongs_to: + - all_containers + trove-infra_hosts: + belongs_to: + - hosts diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index 6c54c26d05..92fcb8a0b0 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -134,6 +134,7 @@ ceilometer_rabbitmq_host_group: "{{ rabbitmq_host_group }}" ## Cinder cinder_service_region: "{{ service_region }}" +cinder_service_port: 8776 # If there are Swift hosts in the environment, then enable cinder backups to it cinder_service_backup_program_enabled: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}" # cinder_backend_rbd_inuse: True if current host has an rbd backend @@ -395,6 +396,7 @@ sahara_rabbitmq_telemetry_host_group: "{{ sahara_rabbitmq_host_group }}" sahara_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['sahara_all'] is defined) and (groups['ceilometer_all'] | length > 0) and (groups['sahara_all'] | length > 0) }}" ## Swift +swift_proxy_port: 8080 swift_system_user_name: swift swift_system_shell: /bin/bash swift_system_comment: swift system user diff --git a/playbooks/inventory/group_vars/trove_all.yml b/playbooks/inventory/group_vars/trove_all.yml new file mode 100644 index 0000000000..ac39b808cd --- /dev/null +++ b/playbooks/inventory/group_vars/trove_all.yml @@ -0,0 +1,42 @@ +--- +# Copyright 2016 Internet Solutions (Pty) Ltd +# +# 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. + +trove_service_region: "{{ service_region }}" +trove_galera_user: trove +trove_galera_database_name: trove_service +trove_galera_address: "{{ galera_address }}" + +# RPC +trove_rabbitmq_userid: trove +trove_rabbitmq_vhost: /trove +trove_rabbitmq_port: "{{ rabbitmq_port }}" +trove_rabbitmq_servers: "{{ rabbitmq_servers }}" +trove_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +trove_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +trove_rabbitmq_telemetry_userid: "{{ trove_rabbitmq_userid }}" +trove_rabbitmq_telemetry_password: "{{ trove_rabbitmq_password }}" +trove_rabbitmq_telemetry_vhost: "{{ trove_rabbitmq_vhost }}" +trove_rabbitmq_telemetry_port: "{{ trove_rabbitmq_port }}" +trove_rabbitmq_telemetry_servers: "{{ trove_rabbitmq_servers }}" +trove_rabbitmq_telemetry_use_ssl: "{{ trove_rabbitmq_use_ssl }}" +trove_rabbitmq_telemetry_host_group: "{{ trove_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +trove_ceilometer_enabled: "{{ (groups['trove_all'] is defined) and (groups['trove_all'] | length > 0) and (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" + +# Ensure that the package state matches the global setting +trove_package_state: "{{ package_state }}" diff --git a/playbooks/os-trove-install.yml b/playbooks/os-trove-install.yml new file mode 100644 index 0000000000..c5f2483dfa --- /dev/null +++ b/playbooks/os-trove-install.yml @@ -0,0 +1,82 @@ +--- +# Copyright 2016 Internet Solutions (Pty) Ltd +# +# 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. +# +# (c) 2016 Donovan Francesco +# (c) 2016 Paul Stevens + +- name: Install trove server + hosts: trove_all + gather_facts: "{{ gather_facts | default(True) }}" + user: root + pre_tasks: + - include: common-tasks/rabbitmq-servers-sort.yml + vars: + sort_group_name: "trove_all" + - include: common-tasks/os-lxc-container-setup.yml + - include: common-tasks/rabbitmq-vhost-user.yml + static: no + vars: + user: "{{ trove_rabbitmq_userid }}" + password: "{{ trove_rabbitmq_password }}" + vhost: "{{ trove_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ trove_rabbitmq_host_group }}" + when: + - inventory_hostname == groups['trove_all'][0] + - groups[trove_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + static: no + vars: + user: "{{ trove_rabbitmq_telemetry_userid }}" + password: "{{ trove_rabbitmq_telemetry_password }}" + vhost: "{{ trove_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ trove_rabbitmq_telemetry_host_group }}" + when: + - trove_ceilometer_enabled | bool + - inventory_hostname == groups['trove_all'][0] + - groups[trove_rabbitmq_telemetry_host_group] is defined + - groups[trove_rabbitmq_telemetry_host_group] | length > 0 + - groups[trove_rabbitmq_telemetry_host_group] != groups[trove_rabbitmq_host_group] + - include: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-trove" + dest: "/var/log/trove" + - include: common-tasks/mysql-db-user.yml + static: no + vars: + user_name: "{{ trove_galera_user }}" + password: "{{ trove_galera_password }}" + login_host: "{{ trove_galera_address }}" + db_name: "{{ trove_galera_database }}" + when: inventory_hostname == groups['trove_all'][0] + - include: common-tasks/package-cache-proxy.yml + roles: + - role: "os_trove" + trove_venv_tag: "{{ openstack_release }}" + trove_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/trove-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" + - role: "openstack_openrc" + tags: + - openrc + - role: "rsyslog_client" + rsyslog_client_log_rotate_file: trove_log_rotate + rsyslog_client_log_dir: "/var/log/trove" + rsyslog_client_config_name: "99-trove-rsyslog-client.conf" + tags: + - rsyslog + vars: + is_metal: "{{ properties.is_metal|default(false) }}" + pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" + tags: + - trove diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index c4cf8b8202..3d6bbfbb56 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -33,4 +33,5 @@ - include: os-gnocchi-install.yml - include: os-ironic-install.yml - include: os-magnum-install.yml +- include: os-trove-install.yml - include: os-sahara-install.yml diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index d52b30af27..10cfc73bd4 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -252,3 +252,11 @@ haproxy_default_services: haproxy_balance_type: http haproxy_backend_options: - "httpchk GET /" + - service: + haproxy_service_name: trove + haproxy_backend_nodes: "{{ groups['trove_api'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_port: 8779 + haproxy_balance_type: http + haproxy_backend_options: + - "httpchk HEAD /" diff --git a/releasenotes/notes/add-trove-to-repo-dec89e1024791765.yaml b/releasenotes/notes/add-trove-to-repo-dec89e1024791765.yaml new file mode 100644 index 0000000000..ba2d5cf07d --- /dev/null +++ b/releasenotes/notes/add-trove-to-repo-dec89e1024791765.yaml @@ -0,0 +1,5 @@ +--- +features: + - Experimental support has been added to allow the deployment of the + the OpenStack trove service when hosts are present in the host + group ``trove-infra_hosts``. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 43f195f972..da4cd4e1dc 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -220,6 +220,16 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'magnum-infra_hosts', 'magnum_all', 'magnum_container', + 'trove_all', + 'trove_api', + 'trove_conductor', + 'trove_taskmanager', + 'trove_conductor_container', + 'trove_api_container', + 'trove_taskmanager_container', + 'trove-infra_containers', + 'trove-infra_hosts', + 'trove-infra_all', 'memcached', 'memcached_all', 'memcached_container',