Merge "Leverage haproxy_endpoint_manage for backends state playbook"

This commit is contained in:
Zuul
2025-08-29 22:40:03 +00:00
committed by Gerrit Code Review
2 changed files with 12 additions and 12 deletions

View File

@@ -37,14 +37,14 @@
register: backends
changed_when: false
- name: Loop through backends to set state
community.general.haproxy:
host: "{{ item }}"
state: "{{ backend_state }}"
socket: /var/run/haproxy.stat
drain: "{{ haproxy_drain | default(False) }}"
shutdown_sessions: "False"
wait: "True"
wait_interval: "{{ haproxy_wait_interval | default(5) }}"
wait_retries: "{{ haproxy_wait_retries | default(24) }}"
with_items: "{{ backends.stdout_lines }}"
- name: Including haproxy_endpoint_manage role
ansible.builtin.include_role:
name: openstack.osa.haproxy_endpoint_manage
vars:
haproxy_host: "{{ backend }}"
haproxy_state: "{{ backend_state }}"
haproxy_target_hosts:
- "{{ inventory_hostname }}"
loop: "{{ backends.stdout_lines }}"
loop_control:
loop_var: backend

View File

@@ -26,7 +26,7 @@
wait_retries: "{{ haproxy_wait_retries | default(24) }}"
weight: "{{ haproxy_weight | default(omit) }}"
delegate_to: "{{ _haproxy_item }}"
with_items: "{{ groups[haproxy_group_name|default('haproxy')] }}"
with_items: "{{ haproxy_target_hosts | default(groups[haproxy_group_name | default('haproxy')]) }}"
loop_control:
loop_var: _haproxy_item
tags: