resolved issue with ENV vars when using become inside/outside of play
diff --git a/roles/juju-user-prep/tasks/main.yml b/roles/juju-user-prep/tasks/main.yml
index 27f1d91..6f675fd 100644
--- a/roles/juju-user-prep/tasks/main.yml
+++ b/roles/juju-user-prep/tasks/main.yml
@@ -3,7 +3,7 @@
- name: Disable host key checking in ~/.ssh/config
lineinfile:
- dest={{ ansible_env['PWD'] }}/.ssh/config
+ dest={{ ansible_user_dir }}/.ssh/config
line="StrictHostKeyChecking no"
create=yes
mode=0600
@@ -11,5 +11,5 @@
- name: Disable host key checking in ~/.ansible.cfg
copy:
src=ansible.cfg
- dest={{ ansible_env['PWD'] }}/.ansible.cfg
+ dest={{ ansible_user_dir }}/.ansible.cfg