Allow deployers to provide haproxy template files

Add new variables, 'octavia_user_haproxy_templates' and
'octavia_haproxy_amphora_template' to allow deployers to provide and use
custom haproxy template files with Octavia.

Change-Id: I9527081d6ba6aac8f5bddc3796f8c2513625bf70
This commit is contained in:
Jimmy McCrory 2017-05-23 09:51:48 -07:00 committed by Jean-Philippe Evrard
parent d9f3aa4522
commit 29a4e44b1b
4 changed files with 33 additions and 3 deletions

View File

@ -269,6 +269,18 @@ octavia_enable_anti_affinity: False
# for amphora creation # for amphora creation
#octavia_amp_availability_zone: #octavia_amp_availability_zone:
# List of haproxy template files to copy from deployment host to octavia hosts
# octavia_user_haproxy_templates:
# - src: "/etc/openstack_deploy/octavia/haproxy_templates/base.cfg.j2"
# dest: "/etc/octavia/templates/base.cfg.j2"
# - src: "/etc/openstack_deploy/octavia/haproxy_templates/haproxy.cfg.j2"
# dest: "/etc/octavia/templates/haproxy.cfg.j2"
# - src: "/etc/openstack_deploy/octavia/haproxy_templates/macros.cfg.j2"
# dest: "/etc/octavia/templates/macros.cfg.j2"
octavia_user_haproxy_templates: {}
# Path of custom haproxy template file
#octavia_haproxy_amphora_template: /etc/octavia/templates/haproxy.cfg.j2
# Name of the Octavia management network in Neutron # Name of the Octavia management network in Neutron
octavia_neutron_management_network_name: lbaas-mgmt octavia_neutron_management_network_name: lbaas-mgmt
# Name of the provider net in the system # Name of the provider net in the system

View File

@ -0,0 +1,7 @@
---
features:
- |
Deployers may provide a list of custom haproxy template files to copy from
the deployment host through the ``octavia_user_haproxy_templates`` variable
and configure Octavia to make use of a custom haproxy template file with
with ``octavia_haproxy_amphora_template`` variable.

View File

@ -56,6 +56,15 @@
- src: "{{ octavia_ca_private_key }}" - src: "{{ octavia_ca_private_key }}"
dest: "/etc/octavia/certs/ca_key.pem" dest: "/etc/octavia/certs/ca_key.pem"
- name: Copy user provided HAProxy templates
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ octavia_system_user_name }}"
group: "{{ octavia_system_group_name }}"
mode: "0640"
with_items: "{{ octavia_user_haproxy_templates }}"
- name: Drop octavia Config(s) - name: Drop octavia Config(s)
config_template: config_template:
src: "{{ item.src }}" src: "{{ item.src }}"

View File

@ -120,7 +120,9 @@ lb_network_name = {{ octavia_neutron_management_network_uuid }}
# base_path = /var/lib/octavia # base_path = /var/lib/octavia
# base_cert_dir = /var/lib/octavia/certs # base_cert_dir = /var/lib/octavia/certs
# Absolute path to a custom HAProxy template file # Absolute path to a custom HAProxy template file
# haproxy_template = {% if octavia_haproxy_amphora_template is defined %}
haproxy_template = {{ octavia_haproxy_amphora_template }}
{% endif %}
# connection_max_retries = 300 # connection_max_retries = 300
# connection_retry_interval = 5 # connection_retry_interval = 5