Merge "Leverage haproxy_endpoint_manage for backends state playbook"
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user