diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index ffc98e290f..c7abacd2f1 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -166,3 +166,7 @@ scm: git src: https://github.com/logan2211/ansible-resolvconf version: master +- name: os_designate + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_designate + version: master diff --git a/doc/source/install-guide/app-advanced-role-docs.rst b/doc/source/install-guide/app-advanced-role-docs.rst index 4fb38ecef8..7fd55b737d 100644 --- a/doc/source/install-guide/app-advanced-role-docs.rst +++ b/doc/source/install-guide/app-advanced-role-docs.rst @@ -39,6 +39,8 @@ OpenStack service roles - `os_cinder `_ +- `os_designate `_ + - `os_glance `_ - `os_gnocchi `_ @@ -90,7 +92,3 @@ Other roles - `openstack_hosts `_ - `rsyslog_client `_ - - - - diff --git a/etc/openstack_deploy/conf.d/designate.yml.aio b/etc/openstack_deploy/conf.d/designate.yml.aio new file mode 100644 index 0000000000..7ec7c2d5d0 --- /dev/null +++ b/etc/openstack_deploy/conf.d/designate.yml.aio @@ -0,0 +1,4 @@ +--- +dnsaas_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/conf.d/designate.yml.example b/etc/openstack_deploy/conf.d/designate.yml.example new file mode 100644 index 0000000000..e559f7caa3 --- /dev/null +++ b/etc/openstack_deploy/conf.d/designate.yml.example @@ -0,0 +1,8 @@ +# The infra nodes that will be running the dnsaas services +dnsaas_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 5a35699124..09c8bd64bb 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -139,3 +139,9 @@ trove_regular_user_password: barbican_galera_password: barbican_rabbitmq_password: barbican_service_password: + +## Designate Options +designate_galera_password: +designate_pool_manager_galera_password: +designate_rabbitmq_password: +designate_service_password: diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index ab6643070a..2bdc895591 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -63,6 +63,13 @@ cinder_git_dest: "/opt/cinder_{{ cinder_git_install_branch | replace('/', '_') } cinder_git_project_group: cinder_all +## Designate service +designate_git_repo: https://git.openstack.org/openstack/designate +designate_git_install_branch: 7dd477815ebea4f7cdf230dec7f2a3e19605a3bb # HEAD of "master" as of 12.10.2016 +designate_git_dest: "/opt/designate_{{ designate_git_install_branch | replace('/', '_') }}" +designate_git_project_group: designate_all + + ## Glance service glance_git_repo: https://git.openstack.org/openstack/glance glance_git_install_branch: 7a89cf7d26c478f7400a3d8ab27ad6429a299deb # HEAD of "master" as of 12.10.2016 diff --git a/playbooks/inventory/env.d/designate.yml b/playbooks/inventory/env.d/designate.yml new file mode 100644 index 0000000000..4eaf94bf6b --- /dev/null +++ b/playbooks/inventory/env.d/designate.yml @@ -0,0 +1,56 @@ +--- +# Copyright 2016, Tata Consultancy Services +# +# 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: + designate_api: + belongs_to: + - designate_all + designate_central: + belongs_to: + - designate_all + designate_mdns: + belongs_to: + - designate_all + designate_pool_manager: + belongs_to: + - designate_all + designate_zone_manager: + belongs_to: + - designate_all + designate_sink: + belongs_to: + - designate_all + +container_skel: + designate_container: + belongs_to: + - dnsaas_containers + contains: + - designate_api + - designate_central + - designate_mdns + - designate_pool_manager + - designate_zone_manager + - designate_sink + properties: + service_name: designate + +physical_skel: + dnsaas_containers: + belongs_to: + - all_containers + dnsaas_hosts: + belongs_to: + - hosts diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index bc9ad89ce9..6bbc36e420 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -332,6 +332,8 @@ neutron_rabbitmq_telemetry_servers: "{{ neutron_rabbitmq_servers }}" neutron_rabbitmq_telemetry_use_ssl: "{{ neutron_rabbitmq_use_ssl }}" neutron_rabbitmq_telemetry_host_group: "{{ neutron_rabbitmq_host_group }}" +# If there are any Designate hosts in the environment, then enable its usage +neutron_designate_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}" # If there are any Ceilometer hosts in the environment, then enable its usage neutron_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" @@ -375,6 +377,8 @@ nova_rabbitmq_telemetry_servers: "{{ nova_rabbitmq_servers }}" nova_rabbitmq_telemetry_use_ssl: "{{ nova_rabbitmq_use_ssl }}" nova_rabbitmq_telemetry_host_group: "{{ nova_rabbitmq_host_group }}" +# If there are any Designate hosts in the environment, then enable its usage +nova_designate_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) }}" # If there are any Ceilometer hosts in the environment, then enable its usage nova_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" diff --git a/playbooks/inventory/group_vars/designate_all.yml b/playbooks/inventory/group_vars/designate_all.yml new file mode 100644 index 0000000000..80b331e711 --- /dev/null +++ b/playbooks/inventory/group_vars/designate_all.yml @@ -0,0 +1,52 @@ +--- +# 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. + +designate_service_port: 9001 +designate_service_proto: http +designate_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(designate_service_proto) }}" +designate_service_adminuri: "{{ designate_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ designate_service_port }}" +designate_service_adminurl: "{{ designate_service_adminuri }}" +designate_service_region: "{{ service_region }}" + +# Galera +designate_galera_address: "{{ galera_address }}" +designate_galera_user: designate +designate_galera_database_name: designate +designate_pool_manager_galera_user: designate_pool_manager +designate_pool_manager_galera_address: "{{ galera_address }}" +designate_pool_manager_galera_database_name: designate_pool_manager + +# RPC +designate_rabbitmq_userid: designate +designate_rabbitmq_vhost: /designate +designate_rabbitmq_port: "{{ rabbitmq_port }}" +designate_rabbitmq_servers: "{{ rabbitmq_servers }}" +designate_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +designate_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +designate_rabbitmq_telemetry_userid: "{{ designate_rabbitmq_userid }}" +designate_rabbitmq_telemetry_password: "{{ designate_rabbitmq_password }}" +designate_rabbitmq_telemetry_vhost: "{{ designate_rabbitmq_vhost }}" +designate_rabbitmq_telemetry_port: "{{ designate_rabbitmq_port }}" +designate_rabbitmq_telemetry_servers: "{{ designate_rabbitmq_servers }}" +designate_rabbitmq_telemetry_use_ssl: "{{ designate_rabbitmq_use_ssl }}" +designate_rabbitmq_telemetry_host_group: "{{ designate_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +designate_ceilometer_enabled: "{{ (groups['designate_all'] is defined) and (groups['designate_all'] | length > 0) and (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" + +# Ensure that the package state matches the global setting +designate_package_state: "{{ package_state }}" diff --git a/playbooks/os-designate-install.yml b/playbooks/os-designate-install.yml new file mode 100644 index 0000000000..bbe0131fc3 --- /dev/null +++ b/playbooks/os-designate-install.yml @@ -0,0 +1,86 @@ +--- +# 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 designate server + hosts: designate_all + gather_facts: "{{ 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: "{{ designate_rabbitmq_userid }}" + password: "{{ designate_rabbitmq_password }}" + vhost: "{{ designate_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ designate_rabbitmq_host_group }}" + when: + - inventory_hostname == groups['designate_all'][0] + - groups[designate_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + static: no + vars: + user: "{{ designate_rabbitmq_telemetry_userid }}" + password: "{{ designate_rabbitmq_telemetry_password }}" + vhost: "{{ designate_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ designate_rabbitmq_telemetry_host_group }}" + when: + - designate_ceilometer_enabled | bool + - inventory_hostname == groups['designate_all'][0] + - groups[designate_rabbitmq_telemetry_host_group] is defined + - groups[designate_rabbitmq_telemetry_host_group] | length > 0 + - groups[designate_rabbitmq_telemetry_host_group] != groups[designate_rabbitmq_host_group] + - include: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-designate" + dest: "/var/log/designate" + - include: common-tasks/mysql-db-user.yml + static: no + vars: + user_name: "{{ designate_galera_user }}" + password: "{{ designate_galera_password }}" + login_host: "{{ designate_galera_address }}" + db_name: "{{ designate_galera_database_name }}" + when: inventory_hostname == groups['designate_all'][0] + - include: common-tasks/mysql-db-user.yml + static: no + vars: + user_name: "{{ designate_pool_manager_galera_user }}" + password: "{{ designate_pool_manager_galera_password }}" + login_host: "{{ designate_pool_manager_galera_address }}" + db_name: "{{ designate_pool_manager_galera_database_name }}" + when: inventory_hostname == groups['designate_all'][0] + - include: common-tasks/package-cache-proxy.yml + roles: + - role: "os_designate" + designate_venv_tag: "{{ openstack_release }}" + designate_venv_download_url: "{{ openstack_repo_url }}/venvs/{{ openstack_release }}/{{ ansible_distribution | lower }}/designate-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" + - role: "openstack_openrc" + tags: + - openrc + - role: "rsyslog_client" + rsyslog_client_log_rotate_file: designate_log_rotate + rsyslog_client_log_dir: "/var/log/designate" + rsyslog_client_config_name: "99-designate-rsyslog-client.conf" + tags: + - rsyslog + vars: + is_metal: "{{ properties.is_metal|default(false) }}" + tags: + - designate diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index 9aba1f4359..082521fbfe 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -268,3 +268,12 @@ haproxy_default_services: haproxy_balance_type: tcp haproxy_backend_options: - tcp-check + - service: + haproxy_service_name: designate_api + haproxy_backend_nodes: "{{ groups['designate_api'] | default([]) }}" + haproxy_port: 9001 + haproxy_balance_type: http + haproxy_backend_options: + - "forwardfor" + - "httpchk /versions" + - "httplog" diff --git a/releasenotes/notes/add-designate-to-repo-7be6ea74870196ff.yaml b/releasenotes/notes/add-designate-to-repo-7be6ea74870196ff.yaml new file mode 100644 index 0000000000..e8bed5c156 --- /dev/null +++ b/releasenotes/notes/add-designate-to-repo-7be6ea74870196ff.yaml @@ -0,0 +1,5 @@ +--- +features: + - Experimental support has been added to allow the deployment of + the OpenStack Designate service when hosts are present in the host + group ``dnsaas_hosts``. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index b947a08e0e..b98b9205dd 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -167,6 +167,17 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'dashboard_hosts', 'database_containers', 'database_hosts', + 'dnsaas_all', + 'dnsaas_containers', + 'dnsaas_hosts', + 'designate_all', + 'designate_container', + 'designate_api', + 'designate_central', + 'designate_mdns', + 'designate_pool_manager', + 'designate_zone_manager', + 'designate_sink', 'galera', 'galera_all', 'galera_container',