zcash-gitian/roles/gitian/tasks/ssh.yml

24 lines
634 B
YAML

---
- name: Check that the SSH key exists locally.
local_action: "stat path={{ lookup('env', 'HOME') }}/.ssh/{{ ssh_key_name }}"
register: ssh_key
- name: Make SSH home directory.
file:
path: "/home/{{ gitian_user }}/.ssh"
state: directory
mode: "0700"
owner: "{{ gitian_user }}"
group: "{{ gitian_user }}"
- name: Copy the SSH public and private key.
synchronize:
src: "{{ lookup('env', 'HOME') }}/.ssh/{{ item }}"
dest: "/home/{{ gitian_user }}/.ssh/{{ item }}"
archive: yes
owner: yes
with_items:
- "{{ ssh_key_name }}"
- "{{ ssh_key_name }}.pub"
when: ssh_key.stat.exists