2019-08-30 20:43:52 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Create SSH key
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.user:
|
2019-08-30 20:43:52 +02:00
|
|
|
name: root
|
|
|
|
generate_ssh_key: true
|
2019-09-06 23:49:40 +02:00
|
|
|
ssh_key_file: "{{ evobackup_client__root_key_path }}"
|
2020-04-24 16:36:36 +02:00
|
|
|
ssh_key_type: "{{ evobackup_client__root_key_type }}"
|
2019-09-06 23:49:40 +02:00
|
|
|
register: evobackup_client__root_key
|
2019-08-30 20:43:52 +02:00
|
|
|
tags:
|
2019-09-06 23:49:40 +02:00
|
|
|
- evobackup_client
|
|
|
|
- evobackup_client_backup_ssh_key
|
2019-08-30 20:43:52 +02:00
|
|
|
|
|
|
|
- name: Print SSH key
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.debug:
|
2019-09-06 23:49:40 +02:00
|
|
|
var: evobackup_client__root_key.ssh_public_key
|
|
|
|
when: evobackup_client__root_key.ssh_public_key is defined
|
2019-08-30 20:43:52 +02:00
|
|
|
tags:
|
2019-09-06 23:49:40 +02:00
|
|
|
- evobackup_client
|
|
|
|
- evobackup_client_backup_ssh_key
|
2019-10-07 18:28:25 +02:00
|
|
|
|
|
|
|
- name: 'copy ssh public key to backup server'
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.copy:
|
2019-10-07 18:28:25 +02:00
|
|
|
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
|
|
|
|
- evobackup_client_backup_ssh_key
|
|
|
|
- evobackup_client_jail
|