2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Install the nginx web server
|
|
|
|
apt: pkg={{ item }} state=installed
|
|
|
|
with_items:
|
|
|
|
- nginx-full
|
|
|
|
when: not nginx_use_ldap_pam_auth
|
2015-08-05 19:14:03 +02:00
|
|
|
tags: nginx
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the nginx web server if we need ldap auth via pam
|
|
|
|
apt: pkg={{ item }} state=installed
|
2015-08-05 19:14:03 +02:00
|
|
|
with_items:
|
2015-05-28 11:32:57 +02:00
|
|
|
- nginx-extras
|
|
|
|
when: nginx_use_ldap_pam_auth
|
2015-08-05 19:14:03 +02:00
|
|
|
tags: nginx
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: remove nginx default config
|
|
|
|
file: dest=/etc/nginx/sites-enabled/default state=absent
|
2015-08-05 19:14:03 +02:00
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'nginx_conf', 'nginx_virtualhost' ]
|
|
|
|
|
|
|
|
- name: Install the gzip compression configuration if enabled
|
|
|
|
template: src=nginx-compression.conf.j2 dest=/etc/nginx/conf.d/compression.conf owner=root group=root mode=0444
|
|
|
|
when: nginx_enable_compression
|
|
|
|
notify: Reload nginx
|
|
|
|
tags: [ 'nginx', 'nginx_conf' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Ensure that the webserver is running
|
|
|
|
service: name=nginx state=started enabled={{ nginx_enabled }}
|
2015-08-05 19:14:03 +02:00
|
|
|
tags: nginx
|