ansible-roles/evobackup-client/tasks/ssh_key.yml
Patrick Marchand de4ba88790
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Dried up the tags for evobackup-client
blocks allow us to assign multiple tags to multiple tasks without
repeating ourselves. This also simplifies other logic like conditional
includes.
2020-06-23 12:07:51 -04:00

29 lines
756 B
YAML

---
- block:
- name: Create SSH key
user:
name: root
generate_ssh_key: true
ssh_key_file: "{{ evobackup_client__root_key_path }}"
ssh_key_type: "{{ evobackup_client__root_key_type }}"
register: evobackup_client__root_key
- name: Print SSH key
debug:
var: evobackup_client__root_key.ssh_public_key
when: evobackup_client__root_key.ssh_public_key is defined
- name: 'copy ssh public key to backup server'
copy:
content: "{{ evobackup_client__root_key.ssh_public_key }}"
dest: "/root/{{ evolinux_hostname }}.pub"
become: true
delegate_to: "{{ evobackup_client__hosts[0].ip }}"
tags:
- evobackup_client_jail
tags:
- evobackup_client
- evobackup_client_ssh_key