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

30 lines
967 B
YAML
Raw Normal View History

2016-04-07 15:50:58 +02:00
---
- name: Install dependencies
apt: name={{ item }} state=present
with_items:
- php5-fpm
- php5-ldap
- php5-sqlite
2016-04-07 15:50:58 +02:00
- name: Create vhost directory
file: path=/var/www/kitchen state=directory owner=www-data group=www-data
- name: Ensure certificates are available
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/www.binary-kitchen.de.key -out /etc/nginx/ssl/www.binary-kitchen.de.crt -days 730 -subj "/CN=www.binary-kitchen.de" creates=/etc/nginx/ssl/www.binary-kitchen.de.crt
notify: Restart nginx
- name: Configure certificate manager
copy: src=certs dest=/etc/acme/domains.d/www.binary-kitchen.de.conf
- name: Configure vhosts
copy: src=vhost dest=/etc/nginx/sites-available/www
notify: Restart nginx
- name: Enable vhosts
file: src=/etc/nginx/sites-available/www dest=/etc/nginx/sites-enabled/www state=link
notify: Restart nginx
- name: Start php5-fpm
service: name=php5-fpm state=started enabled=yes