diff --git a/playbooks/common-tasks/haproxy-endpoint-manage.yml b/playbooks/common-tasks/haproxy-endpoint-manage.yml new file mode 100644 index 0000000000..3af807c263 --- /dev/null +++ b/playbooks/common-tasks/haproxy-endpoint-manage.yml @@ -0,0 +1,26 @@ +--- +# Copyright 2017, Logan Vig +# +# 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: Set haproxy service state + haproxy: + socket: /var/run/haproxy.stat + host: "{{ inventory_hostname }}" + state: "{{ haproxy_state | default('enabled') }}" + shutdown_sessions: "{{ haproxy_shutdown_sessions | default(False) | bool }}" + wait: "{{ haproxy_wait | default(True) | bool }}" + wait_interval: "{{ haproxy_wait_interval | default(5) }}" + wait_retries: "{{ haproxy_wait_retries | default(24) }}" + delegate_to: "{{ item }}" + with_items: "{{ groups['haproxy'] }}" diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 8f135ebfcf..e29a385ee5 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -15,6 +15,7 @@ - name: Installation and setup of Keystone hosts: keystone_all + serial: "{{ keystone_serial }}" gather_facts: "{{ gather_facts | default(True) }}" max_fail_percentage: 20 user: root @@ -76,6 +77,9 @@ with_items: - { key: "net.ipv4.ip_local_reserved_ports", value: "{{ keystone_admin_port }}"} when: is_metal | bool + - include: common-tasks/haproxy-endpoint-manage.yml + haproxy_state: disabled + when: "{{ groups['keystone_all'] | length > 1 }}" roles: - role: "os_keystone" - role: "openstack_openrc" @@ -90,8 +94,15 @@ - role: "system_crontab_coordination" tags: - crontab + post_tasks: + - include: common-tasks/haproxy-endpoint-manage.yml + haproxy_state: enabled + when: "{{ groups['keystone_all'] | length > 1 }}" vars: is_metal: "{{ properties.is_metal|default(false) }}" + keystone_serial: + - 1 + - 100% keystone_admin_port: 35357 keystone_galera_user: keystone keystone_galera_database: keystone