35 lines
1 KiB
YAML
35 lines
1 KiB
YAML
---
|
|
- name: Install Packages
|
|
ansible.builtin.import_tasks: packages.yml
|
|
tags: packages
|
|
|
|
- name: Generate an OpenSSH keypair
|
|
community.crypto.openssh_keypair:
|
|
path: "{{ borg_ssh_key_file_path }}"
|
|
type: "{{ borg_ssh_key_type }}"
|
|
|
|
- name: Setup borgbase backup
|
|
ansible.builtin.import_tasks: borgbase.yml
|
|
when: borgbase is defined and borgbase
|
|
tags: borgbase
|
|
|
|
- name: Copy borgmatic configuration
|
|
ansible.builtin.template:
|
|
src: config.yaml.j2
|
|
dest: "/etc/borgmatic/{{ borgmatic_config_name }}"
|
|
mode: "0600"
|
|
|
|
- name: Add single Cron job for borgmatic
|
|
ansible.builtin.cron:
|
|
name: "{{ borgmatic_timer_cron_name }}"
|
|
hour: "{{ borgmatic_timer_hour }}"
|
|
minute: "{{ borgmatic_timer_minute }}"
|
|
user: "{{ borg_user }}"
|
|
cron_file: "{{ borgmatic_timer_cron_name }}"
|
|
job: "borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }}"
|
|
|
|
- name: Init repo
|
|
ansible.builtin.expect:
|
|
command: "borgmatic init -e {{ borg_repo_key}}"
|
|
responses:
|
|
^.*want to continue connecting.*$: "yes"
|