diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index c1229c78b4..88462ba85d 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -110,6 +110,10 @@ scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_magnum version: master +- name: os_mistral + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_mistral + version: master - name: os_neutron scm: git src: https://git.openstack.org/openstack/openstack-ansible-os_neutron diff --git a/etc/openstack_deploy/conf.d/mistral.yml.aio b/etc/openstack_deploy/conf.d/mistral.yml.aio new file mode 100644 index 0000000000..e246e4c82b --- /dev/null +++ b/etc/openstack_deploy/conf.d/mistral.yml.aio @@ -0,0 +1,3 @@ +mistral-infra_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/conf.d/mistral.yml.example b/etc/openstack_deploy/conf.d/mistral.yml.example new file mode 100644 index 0000000000..d00a355fb2 --- /dev/null +++ b/etc/openstack_deploy/conf.d/mistral.yml.example @@ -0,0 +1,8 @@ +# The infra nodes that will be running the mistal services +mistral-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 dac465cc24..6384181130 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -192,6 +192,11 @@ magnum_oslomsg_rpc_password: #magnum_oslomsg_notify_password: magnum_trustee_password: +# Mistral Options +mistral_service_password: +mistral_galera_password: +mistral_oslomsg_rpc_password: + ## Rally Options: rally_galera_password: diff --git a/inventory/env.d/mistral.yml b/inventory/env.d/mistral.yml new file mode 100644 index 0000000000..ed6c372807 --- /dev/null +++ b/inventory/env.d/mistral.yml @@ -0,0 +1,46 @@ +--- +# Copyright 2019, VEXXHOST, 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. + +component_skel: + mistral_api: + belongs_to: + - mistral_all + mistral_engine: + belongs_to: + - mistral_all + mistral_executor: + belongs_to: + - mistral_all + mistral_notifier: + belongs_to: + - mistral_all + +container_skel: + mistral_container: + belongs_to: + - mistral-infra_containers + contains: + - mistral_api + - mistral_engine + - mistral_executor + - mistral_notifier + +physical_skel: + mistral-infra_containers: + belongs_to: + - all_containers + mistral-infra_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index fde97540a6..0b571adeeb 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -266,6 +266,15 @@ haproxy_default_services: haproxy_backend_options: - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" haproxy_service_enabled: "{{ groups['magnum_all'] is defined and groups['magnum_all'] | length > 0 }}" + - service: + haproxy_service_name: mistral + haproxy_backend_nodes: "{{ groups['mistral_all'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" + haproxy_port: 8989 + haproxy_balance_type: http + haproxy_backend_options: + - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" + haproxy_service_enabled: "{{ groups['mistral_all'] is defined and groups['mistral_all'] | length > 0 }}" - service: haproxy_service_name: trove haproxy_backend_nodes: "{{ groups['trove_api'] | default([]) }}" diff --git a/inventory/group_vars/mistral_all.yml b/inventory/group_vars/mistral_all.yml new file mode 100644 index 0000000000..91b516d8c8 --- /dev/null +++ b/inventory/group_vars/mistral_all.yml @@ -0,0 +1,25 @@ +--- +# Copyright 2019, VEXXHOST, 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. + + +mistral_bind_port: 8989 +mistral_service_proto: http +mistral_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(mistral_service_proto) }}" +mistral_service_publicurl: "{{ mistral_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ mistral_bind_port }}" +mistral_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(mistral_service_proto) }}" +mistral_service_internalurl: "{{ mistral_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ mistral_bind_port }}" +mistral_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(mistral_service_proto) }}" +mistral_service_adminurl: "{{ mistral_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ mistral_bind_port }}" +mistral_service_region: "{{ service_region }}" diff --git a/inventory/inventory.ini b/inventory/inventory.ini index 9a73ed1691..f93f1091e9 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -133,6 +133,12 @@ ironic_server [magnum_all] +[mistral_all:children] +mistral_api +mistral_engine +mistral_executor +mistral_notifier + [neutron_all:children] neutron_agent neutron_bgp_dragent diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index 6768f5f8bc..4256289d16 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -256,6 +256,11 @@ magnum_git_install_branch: 1cca9cc809eb81e666cd332f7275e3bbb34c553b # HEAD as of magnum_git_project_group: magnum_all magnum_git_track_branch: master +## Mistral service +mistral_git_repo: https://git.openstack.org/openstack/mistral +mistral_git_install_branch: 608367f28d10decb0e22a8fe7a58b5c38782a1e9 # HEAD as of 26.02.2019 +mistral_git_project_group: mistral_all +mistral_git_track_branch: master ## Trove service trove_git_repo: https://git.openstack.org/openstack/trove diff --git a/playbooks/os-mistral-install.yml b/playbooks/os-mistral-install.yml new file mode 100644 index 0000000000..6607751811 --- /dev/null +++ b/playbooks/os-mistral-install.yml @@ -0,0 +1,55 @@ +--- +# Copyright 2019, VEXXHOST, 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. + +- name: Install mistral components + hosts: mistral_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + environment: "{{ deployment_environment_variables | default({}) }}" + user: root + vars_files: + - "defaults/{{ install_method }}_install.yml" + tags: + - mistral + pre_tasks: + - include_tasks: "common-tasks/os-{{ container_tech | default('lxc') }}-container-setup.yml" + when: not is_metal + + - name: Configure log directories (on metal) + include_tasks: common-tasks/os-log-dir-setup.yml + vars: + log_dirs: + - src: "/openstack/log/{{ inventory_hostname }}-mistral" + dest: "/var/log/mistral" + + - include_tasks: common-tasks/unbound-clients.yml + when: + - hostvars['localhost']['resolvconf_enabled'] | bool + + - name: Configure package proxy cache + include_tasks: common-tasks/package-cache-proxy.yml + when: install_method == "source" + + roles: + - role: "os_mistral" + - role: "system_crontab_coordination" + tags: + - crontab + + post_tasks: + - include_tasks: "common-tasks/rsyslog-client.yml" + vars: + rsyslog_client_log_rotate_file: mistral_log_rotate + rsyslog_client_log_dir: "/var/log/mistral" + rsyslog_client_config_name: "99-mistral-rsyslog-client.conf" diff --git a/releasenotes/notes/add-mistral-to-repo-deddfe1034291765.yaml b/releasenotes/notes/add-mistral-to-repo-deddfe1034291765.yaml new file mode 100644 index 0000000000..491dc14ac6 --- /dev/null +++ b/releasenotes/notes/add-mistral-to-repo-deddfe1034291765.yaml @@ -0,0 +1,5 @@ +--- +features: + - Adding support for Mistral to be built as part of the repo build process. + - Adding the ``os-mistral-install.yml`` file to deploy mistral to hosts tagged + with hostgroup ``mistral_all`` diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 7745ffc8d1..f4d5248daf 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -275,6 +275,15 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'magnum-infra_hosts', 'magnum_all', 'magnum_container', + 'mistral-infra_all', + 'mistral-infra_containers', + 'mistral-infra_hosts', + 'mistral_all', + 'mistral_container', + 'mistral_api', + 'mistral_engine', + 'mistral_executor', + 'mistral_notifier', 'mano_all', 'mano_containers', 'mano_hosts',