Use connection: local when delegate_to: localhost (#6322)

This will avoid SSH connection on the local host
This commit is contained in:
bozzo
2020-06-25 08:14:38 -07:00
committed by GitHub
parent a6a6e843af
commit 276c450759
12 changed files with 19 additions and 0 deletions
@@ -21,6 +21,7 @@
{{ item }}: "{{ found.get('address', '127.0.0.1') }}"
{% endfor %}
delegate_to: localhost
connection: local
delegate_facts: yes
become: no
run_once: yes
@@ -7,4 +7,5 @@
gather_subset: '!all,network'
filter: "ansible_default_ipv4"
delegate_to: "{{ delegate_host_to_gather_facts }}"
connection: "{{ (delegate_host_to_gather_facts == 'localhost') | ternary('local', omit) }}"
delegate_facts: yes
@@ -19,6 +19,7 @@
{%- endif -%}
127.0.0.1,localhost,{{ kube_service_addresses }},{{ kube_pods_subnet }}
delegate_to: localhost
connection: local
delegate_facts: yes
become: no
run_once: yes