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 17:14:38 +02:00
committed by GitHub
parent a6a6e843af
commit 276c450759
12 changed files with 19 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
mode: "0750"
state: directory
delegate_to: localhost
connection: local
become: no
run_once: yes
when: kubeconfig_localhost
@@ -88,6 +89,7 @@
dest: "{{ artifacts_dir }}/admin.conf"
mode: 0640
delegate_to: localhost
connection: local
become: no
run_once: yes
when: kubeconfig_localhost
@@ -112,4 +114,5 @@
become: no
run_once: yes
delegate_to: localhost
connection: local
when: kubectl_localhost and kubeconfig_localhost

View File

@@ -3,6 +3,7 @@
stat:
path: "{{ inventory_dir }}/../credentials"
delegate_to: localhost
connection: local
register: old_credential_dir
become: no
@@ -10,6 +11,7 @@
stat:
path: "{{ inventory_dir }}/credentials"
delegate_to: localhost
connection: local
register: new_credential_dir
become: no
when: old_credential_dir.stat.exists
@@ -19,6 +21,7 @@
args:
creates: "{{ inventory_dir }}/credentials"
delegate_to: localhost
connection: local
become: no
when:
- old_credential_dir.stat.exists

View File

@@ -9,6 +9,7 @@
{% endif %}
{% endfor %}
delegate_to: localhost
connection: local
delegate_facts: yes
run_once: yes