fix template

This commit is contained in:
Tomislav Kopić 2024-02-10 12:30:43 +01:00
parent ae692c8071
commit 3631ad6c6c

View File

@ -2,7 +2,7 @@
- hosts: all - hosts: all
become: yes become: yes
vars: vars:
borg_repo_path: "/var/backup/backup.borg/" borg_repo_path: "/var/backups/backup.borg/"
borg_repo_encryption: "none" borg_repo_encryption: "none"
borg_backup_paths: "/etc/ /var/spool/ --exclude=*.log" borg_backup_paths: "/etc/ /var/spool/ --exclude=*.log"
tasks: tasks:
@ -14,10 +14,10 @@
- name: "Create backup repository" - name: "Create backup repository"
ansible.builtin.command: borg init -e {{borg_repo_encryption}} {{borg_repo_path}} ansible.builtin.command: borg init -e {{borg_repo_encryption}} {{borg_repo_path}}
args: args:
creates: {borg_repo_path} creates: "{{borg_repo_path}}"
- name: "Configure backup script" - name: "Configure backup script"
ansible.builtin.copy: ansible.builtin.template:
src: ../templates/borgbackup.j2 src: ../templates/borgbackup.j2
dest: /opt/borgbackup.sh dest: /opt/borgbackup.sh
owner: root owner: root