Skip to content

Commit acef0d2

Browse files
committed
change ansible to use FQCN and lowercase restic_systemd_timer_default_OnCalendar
1 parent 1121ff2 commit acef0d2

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
# defaults file for skeleton
32
restic_url: '{{ restic_url_default }}'
43
restic_version: '0.12.1'
54
restic_download_path: '/opt/restic'
@@ -18,7 +17,7 @@ restic_dir_group: '{{ ansible_user | default(ansible_user_id) }}'
1817

1918
# timer defaults
2019
restic_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)
2423
submodules_versioncheck: false

tasks/backup.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
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'
@@ -21,7 +21,7 @@
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'

tasks/configure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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 }}'

tasks/distribution/defaults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# tasks file for skeleton
33

44
- name: Message
5-
debug:
5+
ansible.builtin.debug:
66
msg: 'Your {{ ansible_system }} is not supported'

tasks/install.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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
@@ -26,6 +27,7 @@
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:
@@ -50,3 +52,4 @@
5052
- name: (INSTALL) try restic self-update
5153
become: true
5254
ansible.builtin.command: "{{ restic_install_path }}/restic self-update"
55+
changed_when: true

tasks/restic_create_systemd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@
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

templates/restic.timer.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Description=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) }}
66
RandomizedDelaySec={{ restic_systemd_timer_randomizeddelaysec }}
77
Persistent=true
88

0 commit comments

Comments
 (0)