From a3a1b068fe15b73d226b7058e8039614e090bf35 Mon Sep 17 00:00:00 2001 From: Keith Plant Date: Mon, 11 Nov 2019 12:52:56 -0500 Subject: [PATCH] Add support for custom HAProxy service config Allow users to create/override HAProxy service configuration by copying over '*.cfg' files from {{ node_custom_config }}/haproxy/services.d/ Ex: /etc/kolla/config/haproxy/services.d/radosgw.cfg Change-Id: Id84e3b6e62e544582d6917047534e846e026798d Signed-off-by: Keith Plant --- ansible/roles/haproxy/tasks/config.yml | 16 ++++++++++++++++ ...haproxy-custom-services-c6bc343d162a8990.yaml | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/haproxy-custom-services-c6bc343d162a8990.yaml diff --git a/ansible/roles/haproxy/tasks/config.yml b/ansible/roles/haproxy/tasks/config.yml index fb276fedfb..10bdb77cdf 100644 --- a/ansible/roles/haproxy/tasks/config.yml +++ b/ansible/roles/haproxy/tasks/config.yml @@ -67,6 +67,22 @@ notify: - Restart haproxy container +- name: Copying over custom haproxy services configuration + vars: + service: "{{ haproxy_services['haproxy'] }}" + copy: + src: "{{ item }}" + dest: "{{ node_config_directory }}/haproxy/services.d/" + mode: "0660" + become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool + with_fileglob: + - "{{ node_custom_config }}/haproxy/services.d/*.cfg" + notify: + - Restart haproxy container + - name: Load and persist keepalived module import_role: role: module-load diff --git a/releasenotes/notes/haproxy-custom-services-c6bc343d162a8990.yaml b/releasenotes/notes/haproxy-custom-services-c6bc343d162a8990.yaml new file mode 100644 index 0000000000..43b284a32a --- /dev/null +++ b/releasenotes/notes/haproxy-custom-services-c6bc343d162a8990.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + HAProxy - Add the ability to define custom HAProxy services in + {{ node_custom_config }}/haproxy/services.d/