1
0
forked from infra/ansible
infra/roles/nextcloud/tasks/main.yml

94 lines
2.7 KiB
YAML
Raw Normal View History

2016-04-05 08:44:23 +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"
- name: Enable sury php repository
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-deb ./"
2016-04-05 08:44:23 +02:00
- name: Install packages
apt:
name:
- php8.3
- php8.3-apcu
- php8.3-bcmath
- php8.3-bz2
- php8.3-cli
- php8.3-common
- php8.3-curl
- php8.3-fpm
- php8.3-gd
- php8.3-gmp
- php8.3-imagick
- php8.3-imap
- php8.3-intl
- php8.3-ldap
- php8.3-mbstring
- php8.3-mysql
- php8.3-opcache
- php8.3-pgsql
- php8.3-readline
- php8.3-redis
- php8.3-soap
- php8.3-sqlite3
- php8.3-tidy
- php8.3-xml
- php8.3-xmlrpc
- php8.3-zip
- postgresql
- python3-psycopg2
2016-04-05 08:44:23 +02:00
- name: Configure PostgreSQL user
postgresql_user: name={{ nextcloud_dbuser }} password={{ nextcloud_dbpass }}
2016-04-05 08:44:23 +02:00
become: true
become_user: postgres
- name: Configure PostgreSQL database
postgresql_db: name={{ nextcloud_dbname }} owner={{ nextcloud_dbuser }}
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
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
- name: Configure php8.3-fpm
copy: src=www.conf dest=/etc/php/8.3/fpm/pool.d/www.conf
notify: Restart php8.3-fpm
- name: Configure php8.3 opcache
copy: src=opcache.ini dest=/etc/php/8.3/mods-available/opcache.ini
notify: Restart php8.3-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
- name: Start php8.3-fpm
service: name=php8.3-fpm state=started enabled=yes
2016-04-05 08:44:23 +02:00
- name: Start PostgreSQL
service: name=postgresql state=started enabled=yes
- name: Enable monitoring
include_role: name=icinga-monitor tasks_from=http
vars:
vhost: "{{ nextcloud_domain }}"