File tree Expand file tree Collapse file tree 7 files changed +11
-9
lines changed
Expand file tree Collapse file tree 7 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 11---
2- # defaults file for skeleton
32restic_url : ' {{ restic_url_default }}'
43restic_version : ' 0.12.1'
54restic_download_path : ' /opt/restic'
@@ -18,7 +17,7 @@ restic_dir_group: '{{ ansible_user | default(ansible_user_id) }}'
1817
1918# timer defaults
2019restic_systemd_timer_randomizeddelaysec : ' 4h'
21- restic_systemd_timer_default_OnCalendar : ' *-*-* 02:00:00'
20+ restic_systemd_timer_default_oncalendar : ' *-*-* 02:00:00'
2221
2322# perform simple version check for this role? (true is recomended)
2423submodules_versioncheck : false
Original file line number Diff line number Diff line change 11---
22- name : (BACKUP) reformat dict if necessary
3- set_fact :
3+ ansible.builtin. set_fact :
44 restic_backups : " {{ restic_backups|dict2items|json_query('[*].value') }}"
55 when :
66 - restic_backups | type_debug == "dict"
77
88- name : (BACKUP) Create backup credentials
9- template :
9+ ansible.builtin. template :
1010 src : restic_access_Linux.j2
1111 dest : " {{ restic_script_dir }}/access-{{ item.name | replace(' ', '') }}.sh"
1212 mode : ' 0700'
2121 - item.repo in restic_repos
2222
2323- name : (BACKUP) Create backup script
24- template :
24+ ansible.builtin. template :
2525 src : restic_script_Linux.j2
2626 dest : " {{ restic_script_dir }}/backup-{{ item.name | replace(' ', '') }}.sh"
2727 mode : ' 0700'
Original file line number Diff line number Diff line change 11---
22- name : (CONF)Initialize repository
3- command : ' {{ restic_install_path }}/restic init'
3+ ansible.builtin. command : ' {{ restic_install_path }}/restic init'
44 environment :
55 RESTIC_REPOSITORY : ' {{ item.value.location }}'
66 RESTIC_PASSWORD : ' {{ item.value.password }}'
Original file line number Diff line number Diff line change 22# tasks file for skeleton
33
44- name : Message
5- debug :
5+ ansible.builtin. debug :
66 msg : ' Your {{ ansible_system }} is not supported'
Original file line number Diff line number Diff line change 77 url : ' {{ restic_url }}'
88 dest : ' {{ restic_download_path }}/restic.bz2'
99 force : true
10+ mode : 0644
1011 register : get_url_restic
1112
1213 # TODO: This needs to become independent of the shell module to actually work
2627 ansible.builtin.command : " {{ restic_bin_bath }} version"
2728 ignore_errors : true
2829 register : restic_test_result
30+ changed_when : false
2931
3032 - name : (INSTALL) Remove faulty binary
3133 ansible.builtin.file :
5052 - name : (INSTALL) try restic self-update
5153 become : true
5254 ansible.builtin.command : " {{ restic_install_path }}/restic self-update"
55+ changed_when : true
Original file line number Diff line number Diff line change 6262 - restic_create_schedule | bool
6363 rescue :
6464 - name : set cronjob intead of systemd
65- set_fact :
65+ ansible.builtin. set_fact :
6666 restic_force_cron : true
Original file line number Diff line number Diff line change 22Description=Run restic backup {{ item.name }} every night
33
44[Timer]
5- OnCalendar={{ item.schedule_oncalendar | default(restic_systemd_timer_default_OnCalendar ) }}
5+ OnCalendar={{ item.schedule_oncalendar | default(restic_systemd_timer_default_oncalendar ) }}
66RandomizedDelaySec={{ restic_systemd_timer_randomizeddelaysec }}
77Persistent=true
88
You can’t perform that action at this time.
0 commit comments