From 8393ad3cbcdaf038ca057db03d0ad9c49dd8548a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Steinm=C3=BCller?= Date: Thu, 2 May 2019 22:35:15 +0000 Subject: [PATCH] Add support to deploy placement Depends-On: I7600f1750538335c1348e7d042e6bf450910e12c Depends-On: Id9bd94923e05b3911a9dfd4e10c43f4c0ab81b9b Depends-On: I1ee165b06fe6c6a840784565a7a661b11bf9ebff Depends-On: I4619d333187a0e96c1b60fe2f203df0838c12059 Change-Id: Iae04e60622d1ecde78676c105e35655541065d04 --- ansible-role-requirements.yml | 5 ++ etc/openstack_deploy/conf.d/placement.yml.aio | 3 + .../conf.d/placement.yml.example | 8 +++ .../env.d/aio_metal.yml.example | 3 + etc/openstack_deploy/user_secrets.yml | 7 +++ inventory/env.d/placement.yml | 36 ++++++++++++ inventory/group_vars/haproxy/haproxy.yml | 15 +++-- inventory/group_vars/nova_all.yml | 4 ++ inventory/group_vars/placement_all.yml | 29 ++++++++++ inventory/inventory.ini | 3 + playbooks/defaults/distro_install.yml | 1 + .../repo_packages/openstack_services.yml | 5 ++ playbooks/os-placement-install.yml | 55 +++++++++++++++++++ playbooks/setup-openstack.yml | 1 + .../notes/add-placement-to-repo-adgsaa1233452 | 4 ++ tests/roles/bootstrap-host/vars/main.yml | 2 +- tests/test_inventory.py | 6 ++ 17 files changed, 178 insertions(+), 9 deletions(-) create mode 100644 etc/openstack_deploy/conf.d/placement.yml.aio create mode 100644 etc/openstack_deploy/conf.d/placement.yml.example create mode 100644 inventory/env.d/placement.yml create mode 100644 inventory/group_vars/placement_all.yml create mode 100644 playbooks/os-placement-install.yml create mode 100644 releasenotes/notes/add-placement-to-repo-adgsaa1233452 diff --git a/ansible-role-requirements.yml b/ansible-role-requirements.yml index da3acbe969..4f16f36b6b 100644 --- a/ansible-role-requirements.yml +++ b/ansible-role-requirements.yml @@ -168,6 +168,11 @@ src: https://opendev.org/openstack/openstack-ansible-os_panko version: master trackbranch: master +- name: os_placement + scm: git + src: https://git.openstack.org/openstack/openstack-ansible-os_placement + version: master + trackbranch: master - name: os_rally scm: git src: https://opendev.org/openstack/openstack-ansible-os_rally diff --git a/etc/openstack_deploy/conf.d/placement.yml.aio b/etc/openstack_deploy/conf.d/placement.yml.aio new file mode 100644 index 0000000000..8f49927309 --- /dev/null +++ b/etc/openstack_deploy/conf.d/placement.yml.aio @@ -0,0 +1,3 @@ +placement-infra_hosts: + aio1: + ip: 172.29.236.100 diff --git a/etc/openstack_deploy/conf.d/placement.yml.example b/etc/openstack_deploy/conf.d/placement.yml.example new file mode 100644 index 0000000000..0fda002d1a --- /dev/null +++ b/etc/openstack_deploy/conf.d/placement.yml.example @@ -0,0 +1,8 @@ +# The infra nodes that will be running the placement services +placement-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/env.d/aio_metal.yml.example b/etc/openstack_deploy/env.d/aio_metal.yml.example index 44de09f29d..01120a6ef7 100644 --- a/etc/openstack_deploy/env.d/aio_metal.yml.example +++ b/etc/openstack_deploy/env.d/aio_metal.yml.example @@ -99,6 +99,9 @@ container_skel: panko_container: properties: is_metal: true + placement_container: + properties: + is_metal: true repo_container: properties: is_metal: true diff --git a/etc/openstack_deploy/user_secrets.yml b/etc/openstack_deploy/user_secrets.yml index 381332b674..ef9480f576 100644 --- a/etc/openstack_deploy/user_secrets.yml +++ b/etc/openstack_deploy/user_secrets.yml @@ -285,3 +285,10 @@ manila_profiler_hmac_key: # your user variables. #manila_oslomsg_notify_password: manila_service_password: + +# Placement Options +# TODO(logan): Replace nova_placement_service_password with +# this var and add an upgrade playbook cleaning up the old +# var from user_secrets before releasing Train +# placement_service_password: +placement_galera_password: diff --git a/inventory/env.d/placement.yml b/inventory/env.d/placement.yml new file mode 100644 index 0000000000..5dd862380b --- /dev/null +++ b/inventory/env.d/placement.yml @@ -0,0 +1,36 @@ +--- +# 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: + placement_api: + belongs_to: + - placement_all + +container_skel: + placement_container: + belongs_to: + - os-infra_containers + - placement-infra_containers + contains: + - placement_api + +physical_skel: + placement-infra_containers: + belongs_to: + - all_containers + placement-infra_hosts: + belongs_to: + - hosts diff --git a/inventory/group_vars/haproxy/haproxy.yml b/inventory/group_vars/haproxy/haproxy.yml index dae32fa213..6510a7e850 100644 --- a/inventory/group_vars/haproxy/haproxy.yml +++ b/inventory/group_vars/haproxy/haproxy.yml @@ -160,18 +160,17 @@ haproxy_default_services: - "httpchk HEAD / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" haproxy_service_enabled: "{{ groups['nova_api_os_compute'] is defined and groups['nova_api_os_compute'] | length > 0 }}" - service: - haproxy_service_name: nova_api_placement - haproxy_backend_nodes: "{{ groups['nova_api_placement'] | default([]) }}" - haproxy_ssl: False - haproxy_bind: "{{ [internal_lb_vip_address] }}" + haproxy_service_name: placement + haproxy_backend_nodes: "{{ groups['placement_all'] | default([]) }}" + haproxy_ssl: "{{ haproxy_ssl }}" haproxy_port: 8780 haproxy_balance_type: http haproxy_backend_options: - "httpchk GET / HTTP/1.0\\r\\nUser-agent:\\ osa-haproxy-healthcheck" - haproxy_backend_httpcheck_options: - - "expect status 200" - haproxy_whitelist_networks: "{{ haproxy_nova_placement_whitelist_networks }}" - haproxy_service_enabled: "{{ groups['nova_api_placement'] is defined and groups['nova_api_placement'] | length > 0 }}" + haproxy_service_enabled: "{{ groups['placement_all'] is defined and groups['placement_all'] | length > 0 }}" + - service: + haproxy_service_name: nova_api_placement + state: absent - service: haproxy_service_name: nova_console haproxy_backend_nodes: "{{ groups['nova_console'] | default([]) }}" diff --git a/inventory/group_vars/nova_all.yml b/inventory/group_vars/nova_all.yml index d8d1a231fb..034fb04ca9 100644 --- a/inventory/group_vars/nova_all.yml +++ b/inventory/group_vars/nova_all.yml @@ -67,3 +67,7 @@ nova_reserved_host_disk_mb: 0 neutron_designate_enabled: "{{ hostvars['localhost']['neutron_designate_enabled'] }}" # If there are any Ceilometer hosts in the environment, then enable its usage neutron_ceilometer_enabled: "{{ hostvars['localhost']['neutron_ceilometer_enabled'] }}" + +# TODO(logan): Remove this once placement is removed from os_nova +# Placement is now implemented as a separate service +nova_placement_service_enabled: False diff --git a/inventory/group_vars/placement_all.yml b/inventory/group_vars/placement_all.yml new file mode 100644 index 0000000000..4d7a8fcfd2 --- /dev/null +++ b/inventory/group_vars/placement_all.yml @@ -0,0 +1,29 @@ +--- +# 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. + +placement_service_port: 8780 +placement_service_proto: http +placement_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(placement_service_proto) }}" +placement_service_publicurl: "{{ placement_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ placement_service_port }}" +placement_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(placement_service_proto) }}" +placement_service_internalurl: "{{ placement_service_internaluri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}" +placement_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(placement_service_proto) }}" +placement_service_adminurl: "{{ placement_service_adminuri_proto }}://{{ internal_lb_vip_address }}:{{ placement_service_port }}" +placement_service_region: "{{ service_region }}" + +# TODO(logan): Remove this before releasing Train after adding +# placement_service_password to user_secrets and cleaning up the old +# secret in an upgrade playbook +placement_service_password: "{{ nova_placement_service_password }}" diff --git a/inventory/inventory.ini b/inventory/inventory.ini index fdc1cc1cc8..09b9d1de69 100644 --- a/inventory/inventory.ini +++ b/inventory/inventory.ini @@ -206,6 +206,9 @@ nova_scheduler [panko_all:children] panko_api +[placement_all:children] +placement_api + [rsyslog_all] [sahara_all:children] diff --git a/playbooks/defaults/distro_install.yml b/playbooks/defaults/distro_install.yml index 447d2d8c89..570966e341 100644 --- a/playbooks/defaults/distro_install.yml +++ b/playbooks/defaults/distro_install.yml @@ -54,6 +54,7 @@ nova_bin: /usr/bin octavia_install_method: distro octavia_bin: /usr/bin panko_install_method: distro +placement_install_method: distro rally_install_method: distro sahara_install_method: distro searchlight_install_method: distro diff --git a/playbooks/defaults/repo_packages/openstack_services.yml b/playbooks/defaults/repo_packages/openstack_services.yml index b7942ddc10..58ed29e14c 100644 --- a/playbooks/defaults/repo_packages/openstack_services.yml +++ b/playbooks/defaults/repo_packages/openstack_services.yml @@ -301,6 +301,11 @@ panko_git_install_branch: 91f809625560d770f39299f782eff2b56ec84874 # HEAD as of panko_git_project_group: panko_all panko_git_track_branch: master +## Placement service +placement_git_repo: https://git.openstack.org/openstack/placement +placement_git_install_branch: 8f2a400208d6abb96e7c6feec68fae4dc31095ec # HEAD as of 02.05.2019 +placement_git_project_group: placement_all +placement_git_track_branch: master ## Tacker service tacker_git_repo: https://opendev.org/openstack/tacker diff --git a/playbooks/os-placement-install.yml b/playbooks/os-placement-install.yml new file mode 100644 index 0000000000..b76c808332 --- /dev/null +++ b/playbooks/os-placement-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 placement components + hosts: placement_all + gather_facts: "{{ osa_gather_facts | default(True) }}" + environment: "{{ deployment_environment_variables | default({}) }}" + user: root + vars_files: + - "defaults/{{ install_method }}_install.yml" + tags: + - placement + 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 }}-placement" + dest: "/var/log/placement" + + - 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_placement" + - role: "system_crontab_coordination" + tags: + - crontab + + post_tasks: + - include_tasks: "common-tasks/rsyslog-client.yml" + vars: + rsyslog_client_log_rotate_file: placement_log_rotate + rsyslog_client_log_dir: "/var/log/placement" + rsyslog_client_config_name: "99-placement-rsyslog-client.conf" diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index db33e944bf..39071d0671 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -15,6 +15,7 @@ - import_playbook: os-keystone-install.yml - import_playbook: os-barbican-install.yml +- import_playbook: os-placement-install.yml - import_playbook: os-glance-install.yml - import_playbook: os-cinder-install.yml - import_playbook: os-nova-install.yml diff --git a/releasenotes/notes/add-placement-to-repo-adgsaa1233452 b/releasenotes/notes/add-placement-to-repo-adgsaa1233452 new file mode 100644 index 0000000000..368d774849 --- /dev/null +++ b/releasenotes/notes/add-placement-to-repo-adgsaa1233452 @@ -0,0 +1,4 @@ +--- +features: + - A new playbook ``os-placement-install.yml`` has been added which will deploy the new placement + service to hosts assigned to the host group ``placement-infra_hosts``. diff --git a/tests/roles/bootstrap-host/vars/main.yml b/tests/roles/bootstrap-host/vars/main.yml index c2977e0abd..d097530b85 100644 --- a/tests/roles/bootstrap-host/vars/main.yml +++ b/tests/roles/bootstrap-host/vars/main.yml @@ -33,7 +33,7 @@ bootstrap_host_services: >- {%- set _ = service_list.append('haproxy') %} {%- endif %} {%- if 'aio' in scenario_list or 'translations' in scenario_list %} - {%- set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova']) %} + {%- set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement']) %} {%- if 'metal' not in scenario_list %} {%- set _ = service_list.append('horizon') %} {%- endif %} diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 07fb04a1a3..d7b88bb143 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -327,6 +327,12 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'panko_all', 'panko_api', 'panko_container', + 'placement-infra_all', + 'placement-infra_containers', + 'placement-infra_hosts', + 'placement_all', + 'placement_container', + 'placement_api', 'policy_all', 'policy_containers', 'policy_hosts',