From 693911d520435f5367b06de652614465caccc496 Mon Sep 17 00:00:00 2001 From: Logan V Date: Tue, 14 Jun 2016 15:18:11 -0500 Subject: [PATCH] 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 --- .../install-guide/configure-haproxy.rst | 21 +++++++++++++++++++ playbooks/haproxy-install.yml | 2 +- playbooks/vars/configs/haproxy_config.yml | 2 +- ...aproxy-extra-configs-67a77803494d3e97.yaml | 8 +++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/haproxy-extra-configs-67a77803494d3e97.yaml diff --git a/doc/source/install-guide/configure-haproxy.rst b/doc/source/install-guide/configure-haproxy.rst index 5368ed0a81..5a72c43701 100644 --- a/doc/source/install-guide/configure-haproxy.rst +++ b/doc/source/install-guide/configure-haproxy.rst @@ -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 diff --git a/playbooks/haproxy-install.yml b/playbooks/haproxy-install.yml index 98f342d91e..0cf9fcf685 100644 --- a/playbooks/haproxy-install.yml +++ b/playbooks/haproxy-install.yml @@ -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) }}" - diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index 0a07864b8d..21f2756e18 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -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 diff --git a/releasenotes/notes/haproxy-extra-configs-67a77803494d3e97.yaml b/releasenotes/notes/haproxy-extra-configs-67a77803494d3e97.yaml new file mode 100644 index 0000000000..cec65bb149 --- /dev/null +++ b/releasenotes/notes/haproxy-extra-configs-67a77803494d3e97.yaml @@ -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.