@@ -5,6 +5,7 @@ | |||||
with_items: | with_items: | ||||
- config:system:set trusted_domains 1 --value={{inventory_hostname}} | - config:system:set trusted_domains 1 --value={{inventory_hostname}} | ||||
- maintenance:update:htaccess | - maintenance:update:htaccess | ||||
- background:cron | |||||
args: | args: | ||||
chdir: /var/www/nextcloud | chdir: /var/www/nextcloud | ||||
become: true | become: true | ||||
@@ -0,0 +1,17 @@ | |||||
--- | |||||
- name: cron service | |||||
template: | |||||
src: nextcloud-cron.service | |||||
dest: /etc/systemd/system/nextcloud-cron.service | |||||
- name: cron timer | |||||
template: | |||||
src: nextcloud-cron.timer | |||||
dest: /etc/systemd/system/nextcloud-cron.timer | |||||
- name: cron timer started and enabled | |||||
systemd: | |||||
name: nextcloud-cron.timer | |||||
state: started | |||||
enabled: yes |
@@ -24,3 +24,5 @@ | |||||
- include: upgrade.yml | - include: upgrade.yml | ||||
- include: apache2.yml | - include: apache2.yml | ||||
- include: cron.yml |
@@ -0,0 +1,10 @@ | |||||
[Unit] | |||||
Description=nextcloud cron job | |||||
[Service] | |||||
User=www-data | |||||
Group=www-data | |||||
ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php | |||||
[Install] | |||||
WantedBy=basic.target |
@@ -0,0 +1,10 @@ | |||||
[Unit] | |||||
Description=run nextcloud cron job every 15 minutes | |||||
[Timer] | |||||
OnBootSec=5min | |||||
OnUnitActiveSec=15min | |||||
Unit=nextcloud-cron.service | |||||
[Install] | |||||
WantedBy=timers.target |