role-nextcloud/tasks/main.yml

91 lines
2.3 KiB
YAML
Raw Normal View History

2025-04-24 13:45:04 -05:00
#SPDX-License-Identifier: MIT-0
---
2025-04-24 19:31:31 -05:00
# tasks file for role-nextcloud
2025-04-24 17:54:29 -05:00
- name: install nextcloud and dependencies
ansible.builtin.package:
name:
- nextcloud
- php-legacy-sodium
- php-legacy-imagick
- librsvg
2025-04-24 19:19:10 -05:00
- php-legacy-igbinary
- php-legacy-redis
2025-04-24 20:10:39 -05:00
- php-legacy-fpm
2025-04-24 17:54:29 -05:00
state: present
- name: deploy nextcloud php.ini file
ansible.builtin.copy:
src: files/nextcloud-php.ini
dest: /etc/webapps/nextcloud/php.ini
2025-04-24 19:31:31 -05:00
- name: enforce symlink to nextclound config file
ansible.builtin.file:
src: /mnt/nextcloud/config.php
dest: /etc/webapps/nextcloud/config/config.php
state: link
force: yes
2025-04-24 17:54:29 -05:00
2025-04-24 19:19:10 -05:00
- name: Create sessions directory
ansible.builtin.file:
path: /var/lib/nextcloud/sessions
state: directory
owner: nextcloud
group: nextcloud
mode: '0700'
- name: deploy php-fpm.ini
ansible.builtin.copy:
src: files/php-fpm.ini
dest: /etc/php-legacy/php-fpm.ini
2025-04-24 19:41:05 -05:00
- name: ensure php-fpm.d directory exists
ansible.builtin.file:
path: /etc/php-legacy/php-fpm.d
state: directory
2025-04-24 19:19:10 -05:00
- name: deploy fpm-nextcloud.conf
ansible.builtin.copy:
src: files/fpm-nextcloud.conf
dest: /etc/php-legacy/php-fpm.d/nextcloud.conf
2025-04-24 20:10:39 -05:00
- name: ensure php-fpm override directory exists
2025-04-24 19:58:49 -05:00
ansible.builtin.file:
path: /etc/systemd/system/php-fpm-legacy.service.d/
state: directory
2025-04-24 20:10:39 -05:00
- name: ensure php-fpm log directory exists
ansible.builtin.file:
path:
- /var/log/php-fpm-legacy/
- /var/log/php-fpm-legacy/access/
state: directory
2025-04-24 19:19:10 -05:00
- name: deploy php-fpm systemd override
ansible.builtin.copy:
src: files/php-fpm-override.conf
dest: /etc/systemd/system/php-fpm-legacy.service.d/override.conf
#notify php-fpm-legacy
- name: deploy nextcloud nginx file
2025-04-24 20:10:39 -05:00
ansible.builtin.template:
2025-04-24 20:12:42 -05:00
src: templates/nginx-nextcloud.conf
2025-04-24 19:19:10 -05:00
dest: /etc/nginx/conf.d/nextcloud.conf
#notify nginx
2025-04-24 19:58:49 -05:00
- name: ensure nextcloud-cron override directory exists
ansible.builtin.file:
path: /etc/systemd/system/nextcloud-cron.service.d/
state: directory
2025-04-24 19:19:10 -05:00
- name: deploy nextcloud cron override
ansible.builtin.copy:
src: files/nextcloud-cron-override.conf
dest: /etc/systemd/system/nextcloud-cron.service.d/override.conf
2025-04-24 17:54:29 -05:00
#- name: ensure nextcloud is running
# service:
# name: nextcloud
# state: started
2025-04-24 19:19:10 -05:00
# enabled: yes
# start/enable php-fpm-legacy