commit 099602a461a055b1f1ee022a0c6c71626db5ba8b
parent 028abbb323551de18df69cb97178fafb1ba82dbd
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 22 Feb 2021 21:13:49 +0100
parent 028abbb323551de18df69cb97178fafb1ba82dbd
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 22 Feb 2021 21:13:49 +0100
roles/radicale: split tasks into multiple files
6 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/roles/radicale/handlers/main.yml b/roles/radicale/handlers/main.yml @@ -0,0 +1,17 @@ +--- + +- name: "[OpenRC] Restart service: radicale (to deploy config changes)" + service: + name: radicale + state: restarted + when: + - ansible_service_mgr == "openrc" + listen: "Restart radicale" + +- name: "[systemd] Restart service: radicale (to deploy config changes)" + systemd: + name: radicale + state: restarted + when: + - ansible_service_mgr == "systemd" + listen: "Restart radicale"
diff --git a/roles/radicale/meta/main.yml b/roles/radicale/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: + - role: nginx
diff --git a/roles/radicale/tasks/configure.yml b/roles/radicale/tasks/configure.yml @@ -7,6 +7,7 @@ mode: 0640 owner: root group: radicale + notify: "Restart radicale" - name: "Create file: /etc/radicale/users" copy: @@ -15,6 +16,7 @@ mode: 0640 owner: root group: radicale + notify: "Restart radicale" - name: "Download InfCloud 0.13 to webapps-directory" ansible.builtin.unarchive: @@ -25,7 +27,7 @@ owner: root group: root -- name: "Copy InfCloud to remote" +- name: "Copy InfCloud-config to: /usr/share/webapps/infcloud/config.js" copy: src: infcloud-config.js dest: /usr/share/webapps/infcloud/config.js
diff --git a/roles/radicale/tasks/install.yml b/roles/radicale/tasks/install.yml @@ -4,7 +4,6 @@ apk: name: radicale state: present - update_cache: yes when: - ansible_distribution == "Alpine" @@ -12,6 +11,5 @@ pacman: name: radicale state: present - update_cache: yes when: - ansible_distribution == "Archlinux"
diff --git a/roles/radicale/tasks/remove.yml b/roles/radicale/tasks/remove.yml @@ -35,5 +35,10 @@ path: "{{item}}" state: absent with_items: - - /etc/nginx/conf.d/radicale.conf - - /etc/radicale- \ No newline at end of file + - /etc/radicale + +- name: "Delete nginx vhost for: radicale" + file: + path: /etc/nginx/conf.d/radicale.conf + state: absent + notify: "Restart nginx"
diff --git a/roles/radicale/tasks/start.yml b/roles/radicale/tasks/start.yml @@ -1,17 +1,17 @@ --- -- name: "[OpenRC] Enable and restart service: radicale" +- name: "[OpenRC] Enable and start service: radicale" service: name: radicale enabled: yes - state: restarted + state: started when: - ansible_service_mgr == "openrc" -- name: "[systemd] Enable and restart service: radicale" +- name: "[systemd] Enable and start service: radicale" systemd: name: radicale enabled: yes - state: restarted + state: started when: - ansible_service_mgr == "systemd"