summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-10-13 04:03:03 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-10-13 04:03:03 +0200
commit5cc52df3e0f26297b0dd2c298bf09d9db72b2262 (patch)
tree514e497d544e549807e0d388533969f2073e3d52
parentnextcloud added cron trigger (diff)
nextcloud: fix systemd timer shuffling
-rw-r--r--inventory/host_vars/sk-cloudia/nextcloud.yml20
-rw-r--r--roles/nextcloud/tasks/main.yml33
-rw-r--r--roles/nextcloud/templates/cron-.timer.j2 (renamed from roles/nextcloud/templates/cron@.timer.j2)1
3 files changed, 23 insertions, 31 deletions
diff --git a/inventory/host_vars/sk-cloudia/nextcloud.yml b/inventory/host_vars/sk-cloudia/nextcloud.yml
index 9b14e709..a39c21dd 100644
--- a/inventory/host_vars/sk-cloudia/nextcloud.yml
+++ b/inventory/host_vars/sk-cloudia/nextcloud.yml
@@ -15,13 +15,13 @@ nextcloud_instances:
type: mariadb
version: 10.4.8
password: "{{ vault_nextcloud_database_passwords['wolke.elevate.at'] }}"
- # insomnia.skillz.biz:
- # version: 16.0.5
- # port: 8101
- # hostnames:
- # - insomnia.skillz.biz
- # quota: 200G
- # database:
- # type: mariadb
- # version: 10.4.8
- # password: "{{ vault_nextcloud_database_passwords['insomnia.skillz.biz'] }}"
+ insomnia.skillz.biz:
+ version: 16.0.5
+ port: 8101
+ hostnames:
+ - insomnia.skillz.biz
+ quota: 200G
+ database:
+ type: mariadb
+ version: 10.4.8
+ password: "{{ vault_nextcloud_database_passwords['insomnia.skillz.biz'] }}"
diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml
index 90a65fc6..190afb47 100644
--- a/roles/nextcloud/tasks/main.yml
+++ b/roles/nextcloud/tasks/main.yml
@@ -47,8 +47,6 @@
- name: create nextcloud app subdirectory
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
file:
path: "{{ nextcloud_base_path }}/{{ item }}/nextcloud"
owner: "{{ nextcloud_app_uid }}"
@@ -81,16 +79,12 @@
- name: create image config dir
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
file:
path: "{{ nextcloud_base_path }}/{{ item }}/config"
state: directory
- name: create apache vhost config
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
copy:
content: |
<VirtualHost *:8080>
@@ -107,8 +101,6 @@
- name: configure apache to run on port 8080 only
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
copy:
content: |
Listen 8080
@@ -116,21 +108,11 @@
- name: install cron trigger script
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
template:
src: run-cron.sh.j2
dest: "{{ nextcloud_base_path }}/{{ item }}/config/run-cron.sh"
mode: 0755
-- name: install template systemd units for cron trigger
- loop:
- - service
- - timer
- template:
- src: "cron@.{{ item }}.j2"
- dest: "/etc/systemd/system/nextcloud-cron@.{{ item }}"
-
- name: generate pod manifests
loop: "{{ nextcloud_instances | dict2items }}"
@@ -142,12 +124,21 @@
mode: 0600
+- name: install template systemd unit for cron trigger
+ template:
+ src: cron@.service.j2
+ dest: /etc/systemd/system/nextcloud-cron@.service
+
+- name: install systemd timer unit
+ loop: "{{ nextcloud_instances | list }}"
+ template:
+ src: cron-.timer.j2
+ dest: "/etc/systemd/system/nextcloud-cron-{{ item }}.timer"
+
- name: start/enable cron trigger systemd timer
loop: "{{ nextcloud_instances | list }}"
- loop_control:
- label: "{{ item }}"
systemd:
daemon_reload: yes
- name: "nextcloud-cron@{{ item }}.timer"
+ name: "nextcloud-cron-{{ item }}.timer"
state: started
enabled: yes
diff --git a/roles/nextcloud/templates/cron@.timer.j2 b/roles/nextcloud/templates/cron-.timer.j2
index fc7a247d..7285bf03 100644
--- a/roles/nextcloud/templates/cron@.timer.j2
+++ b/roles/nextcloud/templates/cron-.timer.j2
@@ -3,6 +3,7 @@ Description=Nextcloud cron.php job timer for %i
[Timer]
OnCalendar=*:{{ 15 | random(seed=item) }}/15
+Unit=nextcloud-cron@{{ item }}.service
[Install]
WantedBy=timers.target