diff --git a/README.md b/README.md index 3e4b4e2..ec1e771 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ Requirements Supporte Red Hat 7 et 8. Testé avec keepalived 1.3.5 et 2.0.10. -Attention, si unicast actif alors le playbook a besoin des anisble_facts de l'ensemble des serveurs keepalived (à cause des peer address à remplir dans le fichier de conf). En d'autres termes, en unicast, il faut exécuter le playbook sur tous les LB en même temps (pas de serial 1). - Mode failover : Role Variables -------------- diff --git a/tasks/configure.yml b/tasks/configure.yml index 3dd339f..493af18 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,15 +1,16 @@ --- - name: When unicast enable, gather facts from hosts regardless of limit or tags - setup: - delegate_to: "{{ item }}" - delegate_facts: True - when: - - hostvars[item]['ansible_default_ipv4'] is not defined - - keepalived_unicast|default(false)|bool - with_items: - - "{{ keepalived_master }}" - - "{{ keepalived_backup }}" - tags: always + block: + - name: "Get fact for {{ item }}" + setup: + delegate_to: "{{ item }}" + delegate_facts: True + when: hostvars[item]['ansible_default_ipv4'] is not defined + with_items: + - "{{ keepalived_master }}" + - "{{ keepalived_backup }}" + + when: keepalived_unicast|default(false)|bool - name: Main configuration file from template template: