Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame^] | 1 | --- |
| 2 | # ssh-install/tasks/main.yml |
| 3 | |
| 4 | - name: Create ~/.ssh directory |
| 5 | file: |
| 6 | dest: "{{ ansible_user_dir }}/.ssh/" |
| 7 | mode: 0700 |
| 8 | owner: "{{ ansible_user_id }}" |
| 9 | group: "{{ ansible_user_gid }}" |
| 10 | state: directory |
| 11 | |
| 12 | - name: Install ssh private key |
| 13 | copy: |
| 14 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 15 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}" |
| 16 | mode: 0600 |
| 17 | owner: "{{ ansible_user_id }}" |
| 18 | group: "{{ ansible_user_gid }}" |
| 19 | backup: true |
| 20 | |
| 21 | - name: Install ssh public key |
| 22 | copy: |
| 23 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 24 | dest: "{{ ansible_user_dir }}/.ssh/id_{{ ssh_keytype }}.pub" |
| 25 | mode: 0600 |
| 26 | owner: "{{ ansible_user_id }}" |
| 27 | group: "{{ ansible_user_gid }}" |
| 28 | backup: true |
| 29 | |