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

@@ -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