28 lines
772 B
YAML
28 lines
772 B
YAML
- name: Copy host public key
|
|
template:
|
|
src: "{{ role_path }}/templates/ssh_host_ed25519_key.pub.j2"
|
|
dest: "/etc/ssh/ssh_host_ed25519_key.pub"
|
|
mode: 0644
|
|
- name: Copy host private key
|
|
copy:
|
|
src: "{{ role_path }}/files/ssh_host_ed25519_key"
|
|
dest: "/etc/ssh/ssh_host_ed25519_key"
|
|
mode: 0600
|
|
- name: APT upgrade
|
|
apt:
|
|
autoremove: true
|
|
upgrade: yes
|
|
state: latest
|
|
update_cache: yes
|
|
cache_valid_time: 86400 # One day
|
|
- name: Install borg
|
|
apt:
|
|
name: borgbackup
|
|
- name: Add Borg public key
|
|
authorized_key:
|
|
key: "ssh-ed25519 {{ borg_public_key }} root@max"
|
|
user: "{{ ansible_user_id }}"
|
|
- name: Create Borg repository
|
|
command:
|
|
cmd: "borg init -e none {{ backup_location }}"
|
|
creates: "{{ backup_location }}"
|