library/roles/nginx/tasks/nginx.yml: Add support for the Ubuntu nginx ppa. Disabled by default.

This commit is contained in:
Andrea Dell'Amico 2016-06-29 17:13:42 +02:00
parent d1f1f5c7a0
commit 88e26ff0f4
1 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,11 @@
---
- name: Install the Ubuntu PPA for nginx
apt_repository: repo='{{ nginx_ppa_repo }}'
when: nginx_use_ppa
tags: [ 'nginx', 'nginx_ppa' ]
- name: Install the nginx web server
apt: pkg={{ item }} state=installed
apt: pkg={{ item }} state={{ nginx_package_state }} update_cache=yes
with_items:
- nginx-full
when: not nginx_use_ldap_pam_auth
@ -24,14 +29,3 @@
notify: Reload nginx
tags: [ 'nginx', 'nginx_conf' ]
- name: Ensure that the webserver is running and enabled at boot time
service: name=nginx state=started enabled=yes
when: nginx_enabled
ignore_errors: True
tags: nginx
- name: Ensure that the webserver is stopped and disabled
service: name=nginx state=stopped enabled=no
when: not nginx_enabled
ignore_errors: True
tags: nginx