2016-04-05 08:44:23 +02:00
|
|
|
---
|
|
|
|
|
2019-05-20 21:35:58 +02:00
|
|
|
- name: Enable sury php apt-key
|
2019-07-23 12:00:59 +02:00
|
|
|
apt_key: url="https://packages.sury.org/php/apt.gpg"
|
2019-05-20 21:35:58 +02:00
|
|
|
|
|
|
|
- name: Enable sury php repository
|
2021-09-29 17:27:13 +02:00
|
|
|
apt_repository: repo="deb https://packages.sury.org/php/ {{ ansible_distribution_release }} main"
|
|
|
|
|
|
|
|
- name: Enable collaboraoffice apt-key
|
|
|
|
apt_key: url="https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg"
|
|
|
|
|
|
|
|
- name: Enable collaboraoffice repository
|
|
|
|
apt_repository: repo="deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian11 ./"
|
2019-05-20 21:35:58 +02:00
|
|
|
|
2016-04-05 08:44:23 +02:00
|
|
|
- name: Install packages
|
2020-11-13 21:35:15 +01:00
|
|
|
apt:
|
|
|
|
name:
|
2022-05-24 15:36:22 +02:00
|
|
|
- php8.1
|
|
|
|
- php8.1-apcu
|
|
|
|
- php8.1-bcmath
|
|
|
|
- php8.1-bz2
|
|
|
|
- php8.1-cli
|
|
|
|
- php8.1-common
|
|
|
|
- php8.1-curl
|
|
|
|
- php8.1-dev
|
|
|
|
- php8.1-fpm
|
|
|
|
- php8.1-gd
|
|
|
|
- php8.1-gmp
|
|
|
|
- php8.1-imagick
|
|
|
|
- php8.1-imap
|
|
|
|
- php8.1-intl
|
|
|
|
- php8.1-ldap
|
|
|
|
- php8.1-mbstring
|
|
|
|
- php8.1-mysql
|
|
|
|
- php8.1-opcache
|
|
|
|
- php8.1-pgsql
|
|
|
|
- php8.1-readline
|
|
|
|
- php8.1-redis
|
|
|
|
- php8.1-soap
|
|
|
|
- php8.1-sqlite3
|
|
|
|
- php8.1-tidy
|
|
|
|
- php8.1-xml
|
|
|
|
- php8.1-xmlrpc
|
|
|
|
- php8.1-zip
|
2020-11-13 21:35:15 +01:00
|
|
|
- postgresql
|
2021-06-03 15:14:55 +02:00
|
|
|
- python3-psycopg2
|
2016-04-05 08:44:23 +02:00
|
|
|
|
|
|
|
- name: Configure PostgreSQL database
|
2021-09-29 17:27:13 +02:00
|
|
|
postgresql_db: name={{ nextcloud_dbname }}
|
2016-04-05 08:44:23 +02:00
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
|
|
|
|
- name: Configure PostgreSQL user
|
2021-09-29 17:27:13 +02:00
|
|
|
postgresql_user: db={{ nextcloud_dbname }} name={{ nextcloud_dbuser }} password={{ nextcloud_dbpass }} priv=ALL state=present
|
2016-04-05 08:44:23 +02:00
|
|
|
become: true
|
|
|
|
become_user: postgres
|
|
|
|
|
|
|
|
- name: Ensure certificates are available
|
2019-05-20 20:55:05 +02:00
|
|
|
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ nextcloud_domain }}.key -out /etc/nginx/ssl/{{ nextcloud_domain }}.crt -days 730 -subj "/CN={{ nextcloud_domain }}" creates=/etc/nginx/ssl/{{ nextcloud_domain }}.crt
|
2016-04-05 08:44:23 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2019-05-20 20:55:05 +02:00
|
|
|
- name: Configure certificate manager for nextcloud
|
|
|
|
template: src=certs.j2 dest=/etc/acertmgr/{{ nextcloud_domain }}.conf
|
2019-02-23 23:54:24 +01:00
|
|
|
notify: Run acertmgr
|
2016-04-05 08:44:23 +02:00
|
|
|
|
|
|
|
- name: Create vhost directory
|
2019-05-20 20:55:05 +02:00
|
|
|
file: path=/var/www/nextcloud state=directory owner=www-data group=www-data
|
2016-04-05 08:44:23 +02:00
|
|
|
|
|
|
|
- name: Configure vhost
|
2019-05-20 20:55:05 +02:00
|
|
|
template: src=vhost.j2 dest=/etc/nginx/sites-available/nextcloud
|
2016-04-05 08:44:23 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2022-05-24 15:36:22 +02:00
|
|
|
- name: Configure php8.1-fpm
|
|
|
|
copy: src=www.conf dest=/etc/php/8.1/fpm/pool.d/www.conf
|
|
|
|
notify: Restart php8.1-fpm
|
2017-07-01 16:33:15 +02:00
|
|
|
|
2022-05-24 15:36:22 +02:00
|
|
|
- name: Configure php8.1 opcache
|
|
|
|
copy: src=opcache.ini dest=/etc/php/8.1/mods-available/opcache.ini
|
|
|
|
notify: Restart php8.1-fpm
|
2016-04-06 10:19:01 +02:00
|
|
|
|
2016-04-09 23:41:41 +02:00
|
|
|
- name: Enable vhost
|
2019-05-20 20:55:05 +02:00
|
|
|
file: src=/etc/nginx/sites-available/nextcloud dest=/etc/nginx/sites-enabled/nextcloud state=link
|
2016-04-05 08:44:23 +02:00
|
|
|
notify: Restart nginx
|
|
|
|
|
2022-05-24 15:36:22 +02:00
|
|
|
- name: Start php8.1-fpm
|
|
|
|
service: name=php8.1-fpm state=started enabled=yes
|
2016-04-05 08:44:23 +02:00
|
|
|
|
|
|
|
- name: Start PostgreSQL
|
|
|
|
service: name=postgresql state=started enabled=yes
|