Skip to content

Commit

Permalink
Add cronjob to automatically update all apps every two days
Browse files Browse the repository at this point in the history
  • Loading branch information
doobry-systemli committed Oct 1, 2024
1 parent b1229d7 commit d806e13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,7 @@ nextcloud_notify_push_port: 7867
# Cleanup old nextcloud version folders
nextcloud_cleanup_versions: True
nextcloud_cleanup_versions_keep: 4

# Configure automatic app updates via cron
nextcloud_app_update_cronjob: True
nextcloud_app_update_cronjob_weekday: "1,3,5"
14 changes: 14 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@
- role:nextcloud:install
- role:nextcloud:upgrade

- name: Create Nextcloud app update cronjob
ansible.builtin.cron:
name: "Nextcloud app update cronjob"

Check warning on line 117 in tasks/main.yml

View workflow job for this annotation

GitHub Actions / Integration / Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ nextcloud_app_update_cronjob|ternary('present', 'absent') }} -> {{ nextcloud_app_update_cronjob | ternary('present', 'absent') }}
minute: 0
hour: 6
weekday: "{{ nextcloud_app_update_cronjob_weekday }}"
user: "{{ nextcloud_http_user }}"
job: "php -f {{ nextcloud_instance }}/occ app:update --all >/dev/null"
cron_file: nextcloud
state: "{{ nextcloud_app_update_cronjob|ternary('present', 'absent') }}"
tags:
- role:nextcloud:install
- role:nextcloud:upgrade

- name: Create Nextcloud logrotate rule
ansible.builtin.template:
src: nextcloud/nextcloud.logrotate.j2
Expand Down

0 comments on commit d806e13

Please sign in to comment.