CORD-1067 Resolve remote home dir for SSH key copy
Change-Id: I3ee8f55e34474c6ca478b908f991ebd7ce9ce0d2
diff --git a/roles/cord-profile/tasks/main.yml b/roles/cord-profile/tasks/main.yml
index 85af01c..5782795 100644
--- a/roles/cord-profile/tasks/main.yml
+++ b/roles/cord-profile/tasks/main.yml
@@ -46,7 +46,8 @@
- name: Copy ssh keys to key_import directory
copy:
- src: "{{ item.source_path | expanduser }}"
+ # 'expanduser' won't work below, it expands on control machine
+ src: "{{ item.source_path | replace('~', ansible_env.HOME, 1) }}"
dest: "{{ cord_profile_dir }}/key_import/{{ item.name }}"
mode: 0600
remote_src: True