duplicty - add azure backend

This commit is contained in:
camille 2023-03-03 17:02:53 +01:00
parent bcbcc6ae59
commit ce703e5692

View File

@ -7,6 +7,17 @@
- duplicity_s3_passphrase is defined - duplicity_s3_passphrase is defined
- duplicity_s3_access_key is defined - duplicity_s3_access_key is defined
- duplicity_s3_secret_key is defined - duplicity_s3_secret_key is defined
when:
- duplicity_backend == s3
tags: ['backup_duplicity']
- name: duplicity | check vars are defined
assert:
that:
- duplicity_archive_dir is defined
- duplicity_azure_path is defined
when:
- duplicity_backend == azure
tags: ['backup_duplicity'] tags: ['backup_duplicity']
- name: duplicity | install packages - name: duplicity | install packages
@ -217,6 +228,7 @@
job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_s3_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}" job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --s3-use-new-style -v 4 --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_s3_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}"
when: when:
- duplicity_gpg_key is defined - duplicity_gpg_key is defined
- duplicity_backend == s3
tags: ['backup_duplicity'] tags: ['backup_duplicity']
- name: duplicity | create cleanup cronjob - name: duplicity | create cleanup cronjob
@ -231,4 +243,35 @@
job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force --s3-use-new-style -v 4 remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\"" job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force --s3-use-new-style -v 4 remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_s3_path }}\""
when: when:
- duplicity_gpg_key is defined - duplicity_gpg_key is defined
- duplicity_backend == s3
tags: ['backup_duplicity']
- name: duplicity | create backup cronjob
cron:
name: duplicity backup
minute: "{{ duplicity_cron_backup_minute }}"
hour: "{{ duplicity_cron_backup_hour }}"
day: "{{ duplicity_cron_backup_day }}"
month: "{{ duplicity_cron_backup_month }}"
weekday: "{{ duplicity_cron_backup_weekday }}"
user: "{{ duplicity_cron_backup_user }}"
job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --archive-dir={{ duplicity_archive_dir }} --full-if-older-than {{ duplicity_full_older_than }}D / \"{{ duplicity_azure_path }}\" --exclude-filelist {{ duplicity_exclude_filelist }}"
when:
- duplicity_gpg_key is defined
- duplicity_backend == azure
tags: ['backup_duplicity']
- name: duplicity | create cleanup cronjob
cron:
name: duplicity cleanup
minute: "{{ duplicity_cron_backup_minute+30 }}"
hour: "{{ duplicity_cron_backup_hour+3 }}"
day: "{{ duplicity_cron_backup_day }}"
month: "{{ duplicity_cron_backup_month }}"
weekday: "{{ duplicity_cron_backup_weekday }}"
user: "{{ duplicity_cron_backup_user }}"
job: ". /etc/duplicity/duplicity.cnf && duplicity --encrypt-key {{ duplicity_gpg_key }} --force remove-older-than {{ duplicity_remove_older_than }}D \"{{ duplicity_azure_path }}\""
when:
- duplicity_gpg_key is defined
- duplicity_backend == azure
tags: ['backup_duplicity'] tags: ['backup_duplicity']