2015-05-28 11:32:57 +02:00
|
|
|
---
|
2016-06-29 17:13:42 +02:00
|
|
|
- name: Install the Ubuntu PPA for nginx
|
|
|
|
apt_repository: repo='{{ nginx_ppa_repo }}'
|
2016-06-29 17:15:36 +02:00
|
|
|
when:
|
|
|
|
- nginx_use_ppa
|
2016-06-29 17:29:57 +02:00
|
|
|
- "'{{ ansible_distribution }}' == 'Ubuntu'"
|
2016-06-29 17:13:42 +02:00
|
|
|
tags: [ 'nginx', 'nginx_ppa' ]
|
|
|
|
|
2015-05-28 11:32:57 +02:00
|
|
|
- name: Install the nginx web server
|
2016-06-29 17:13:42 +02:00
|
|
|
apt: pkg={{ item }} state={{ nginx_package_state }} update_cache=yes
|
2015-05-28 11:32:57 +02:00
|
|
|
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
|
|
|
|