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

60 lines
1.8 KiB
YAML
Raw Normal View History

2016-04-05 08:44:23 +02:00
---
- name: Install packages
2017-07-02 22:17:32 +02:00
apt: name={{ item }}
2016-04-05 08:44:23 +02:00
with_items:
- php7.0-apcu
- php7.0-curl
- php7.0-fpm
- php7.0-gd
- php7.0-ldap
- php7.0-mbstring
- php7.0-pgsql
- php7.0-xml
- php7.0-zip
- php-redis
2016-04-05 08:44:23 +02:00
- postgresql
- python-psycopg2
- name: Configure PostgreSQL database
postgresql_db: name={{ owncloud_dbname }}
2016-04-05 08:44:23 +02:00
become: true
become_user: postgres
- name: Configure PostgreSQL user
postgresql_user: db={{ owncloud_dbname }} name={{ owncloud_dbuser }} password={{ owncloud_dbpass }} priv=ALL state=present
become: true
become_user: postgres
- name: Ensure certificates are available
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ owncloud_domain }}.key -out /etc/nginx/ssl/{{ owncloud_domain }}.crt -days 730 -subj "/CN={{ owncloud_domain }}" creates=/etc/nginx/ssl/{{ owncloud_domain }}.crt
notify: Restart nginx
- name: Configure certificate manager for owncloud
template: src=certs.j2 dest=/etc/acme/domains.d/{{ owncloud_domain }}.conf
- name: Create vhost directory
file: path=/var/www/owncloud state=directory owner=www-data group=www-data
- name: Configure vhost
template: src=vhost.j2 dest=/etc/nginx/sites-available/owncloud
notify: Restart nginx
- name: Configure php7.0-fpm
copy: src=www.conf dest=/etc/php/7.0/fpm/pool.d/www.conf
notify: Restart php7.0-fpm
- name: Configure php7.0 opcache
copy: src=opcache.ini dest=/etc/php/7.0/mods-available/opcache.ini
notify: Restart php7.0-fpm
2016-04-06 10:19:01 +02:00
2016-04-09 23:41:41 +02:00
- name: Enable vhost
2016-04-05 08:44:23 +02:00
file: src=/etc/nginx/sites-available/owncloud dest=/etc/nginx/sites-enabled/owncloud state=link
notify: Restart nginx
- name: Start php7.0-fpm
service: name=php7.0-fpm state=started enabled=yes
2016-04-05 08:44:23 +02:00
- name: Start PostgreSQL
service: name=postgresql state=started enabled=yes