HAProxy extra endpoints

Allow the operator to define a list of additional HAProxy endpoints
without overriding the entire haproxy_service_configs list.

This moves the default endpoints to a var called haproxy_default_services
and combines the default services list with haproxy_extra_services if
defined.

Change-Id: I701a6e8740c0afa326b6e2310b46822c37a3e50d
This commit is contained in:
Logan V 2016-06-14 15:18:11 -05:00
parent 4813b7cdf0
commit 693911d520
4 changed files with 31 additions and 2 deletions

View File

@ -146,6 +146,27 @@ certificates and keys to use with HAProxy.
.. _Securing services with SSL certificates: configure-sslcertificates.html
Configuring additional services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Additional haproxy service entries can be configured by setting
``haproxy_extra_services`` in ``/etc/openstack_deploy/user_variables.yml``
For more information on the service dict syntax, please reference
``playbooks/vars/configs/haproxy_config.yml``
An example HTTP service could look like:
.. code-block:: yaml
haproxy_extra_services:
- service:
haproxy_service_name: extra-web-service
haproxy_backend_nodes: "{{ groups['service_group'] | default([]) }}"
haproxy_ssl: "{{ haproxy_ssl }}"
haproxy_port: 10000
haproxy_balance_type: http
--------------
.. include:: navigation.txt

View File

@ -101,6 +101,7 @@
- haproxy-service-config
roles:
- role: "haproxy_server"
haproxy_service_configs: "{{ haproxy_default_services + haproxy_extra_services|default([]) }}"
tags:
- "haproxy-server"
- role: "rsyslog_client"
@ -114,4 +115,3 @@
- vars/configs/haproxy_config.yml
vars:
is_metal: "{{ properties.is_metal|default(false) }}"

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
haproxy_service_configs:
haproxy_default_services:
- service:
haproxy_service_name: galera
haproxy_backend_nodes: "{{ [groups['galera_all'][0]] | default([]) }}" # list expected

View File

@ -0,0 +1,8 @@
---
features:
- Added a new ``haproxy_extra_services`` var which will allow extra haproxy
endpoint additions.
deprecations:
- Moved ``haproxy_service_configs`` var to ``haproxy_default_service_configs``
so that ``haproxy_service_configs`` can be modified and added to without
overriding the entire default service dict.