diff --git a/nginx/tasks/nginx.yml b/nginx/tasks/nginx.yml index ef09fa6a..f42e46ec 100644 --- a/nginx/tasks/nginx.yml +++ b/nginx/tasks/nginx.yml @@ -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