Use ansible_user_dir for SSH config

Drop the ssh client config in the ansible user's home directory
instead of hard coded /root.

Change-Id: Iff4d2b4793d3fac3d8a6e58cab4f0d00ce3df123
This commit is contained in:
Logan V 2018-09-13 11:59:58 -06:00
parent 27152d9739
commit 17a0f6aa98
1 changed files with 4 additions and 11 deletions

View File

@ -15,25 +15,18 @@
dest: "{{ vault_key_path }}"
mode: '0600'
# Drop the SSH proxyjump configuration
- hosts: all
become: yes
become_user: root
tasks:
# Drop the SSH proxyjump configuration
- name: Ensure the SSH configuration directory exists
file:
path: /root/.ssh
path: "{{ ansible_user_dir }}/.ssh"
state: directory
- name: Copy the SSH proxy configuration
copy:
src: "{{ lsn_ci_src_path }}/ssh/ssh_config"
dest: /root/.ssh/config
dest: "{{ ansible_user_dir }}/.ssh/config"
remote_src: yes
# Start SSH agent and load the deployment key
- hosts: all
tasks:
# Load the deployment SSH key
# Start SSH agent and load the deployment key
- name: Create the SSH private key tempfile
tempfile:
state: file