role-nextcloud/tasks/main.yml
2024-02-04 01:53:47 +01:00

95 lines
2.3 KiB
YAML

---
- name: Create podman folder
file:
path: /etc/containers/systemd
state: directory
mode: 0775
recurse: yes
- name: Create nextcloud folder
file:
path: "/var/nextcloud/app"
state: directory
mode: 0775
recurse: yes
- name: Create nginx folder
file:
path: "/var/nextcloud/web"
state: directory
mode: 0775
recurse: yes
- name: Create nextcloud redis folder
file:
path: "/var/nextcloud/redis"
state: directory
mode: 0775
recurse: yes
- name: Create nextcloud postgres folder
file:
path: "/var/nextcloud/postgres"
state: directory
mode: 0775
recurse: yes
- name: Copy nginx.conf
ansible.builtin.template:
src: nginx.conf.j2
dest: "/var/nextcloud/web/nginx.conf"
- name: Setup Podman quadlet
block:
- name: Copy nextcloud.network
ansible.builtin.template:
src: nextcloud.network
dest: "/etc/containers/systemd/nextcloud.network"
- name: Copy nextcloud-app.container
ansible.builtin.template:
src: nextcloud-app.quadlet.j2
dest: "/etc/containers/systemd/nextcloud-app.container"
- name: Copy nextcloud-cron.container
ansible.builtin.template:
src: nextcloud-cron.quadlet.j2
dest: "/etc/containers/systemd/nextcloud-cron.container"
- name: Copy nextcloud-postgres.container
ansible.builtin.template:
src: nextcloud-postgres.quadlet.j2
dest: "/etc/containers/systemd/nextcloud-postgres.container"
- name: Copy nextcloud-redis.container
ansible.builtin.template:
src: nextcloud-redis.quadlet.j2
dest: "/etc/containers/systemd/nextcloud-redis.container"
- name: Copy nextcloud-web.container
ansible.builtin.template:
src: nextcloud-web.quadlet.j2
dest: "/etc/containers/systemd/nextcloud-web.container"
- name: "Reload systemd"
ansible.builtin.systemd:
daemon_reload: true
when: ansible_service_mgr == "systemd"
- name: Start Nextcloud Redis
systemd_service:
enabled: true
name: nextcloud-redis
state: started
- name: Start nextcloud Postgres
systemd_service:
enabled: true
name: nextcloud-postgres
state: started
notify:
- Restart Nextcloud App
- Restart Nextcloud Cron
- Restart Nextcloud Web