forked from evolix/ansible-roles
956ecd4700
The behaviour of the `include` module is badly defined (it try to choose between statically importing the tasks and dynamically including them) and can cause problems depending on any number of constraints (mostly if it choose the wrong behaviour). Replace it with the `import_tasks` (always statically import tasks) unless the `include` is in a loop in which case we replace it with `include_tasks` (always dynamically include tasks).
28 lines
584 B
YAML
28 lines
584 B
YAML
|
|
|
|
- set_fact:
|
|
nginx_default_package_name: nginx-light
|
|
when: nginx_minimal | bool
|
|
|
|
- import_tasks: packages_backports.yml
|
|
when: nginx_backports | bool
|
|
|
|
# TODO: install "nginx" + only necessary modules, instead of "nginx-full"
|
|
|
|
- name: Nginx is installed
|
|
apt:
|
|
name: "{{ nginx_package_name | default(nginx_default_package_name) }}"
|
|
state: present
|
|
tags:
|
|
- nginx
|
|
- packages
|
|
|
|
- name: Service is running as configured.
|
|
service:
|
|
name: nginx
|
|
state: "{{ nginx_service_state }}"
|
|
enabled: "{{ nginx_service_enabled }}"
|
|
tags:
|
|
- nginx
|
|
- packages
|