summaryrefslogtreecommitdiff
path: root/playbooks/roles/borg/tasks/main.yml
blob: fd3be9969463a9bb868192ac42b2d5a06632095b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
- name: copy key
  template:
    src: ../templates/borg_ssh_key.j2
    dest: /root/borg_ssh_key
    owner: root
    group: root
    mode: 0600

- name: push borg
  import_role: 
    name: borgbase.ansible_role_borgbackup
  vars:
    borg_encryption_passphrase: "{{ borg_password }}"
    borg_repository: "{{ borg_repo }}"
    borg_user: "{{ borg_my_user }}"
    borg_group: "{{ borg_my_group }}"
    borgmatic_timer: cron
    borg_ssh_command: "ssh -o StrictHostKeyChecking=no -i {{ borg_ssh_key }}"
    borg_source_directories:
      "{{ base_files + (extra_files[inventory_hostname] | default([])) }}"
    borg_retention_policy:
      keep_hourly: 3
      keep_daily: 7
      keep_weekly: 4
      keep_monthly: 6
    borgmatic_hooks:
      after_backup:
        - "curl -d '{{ inventory_hostname }}' {{ backup_topic }}"