roles/nginx: Use dynamic includes for tasks
As of Ansible 2.4 and 2.5 the behavior for importing tasks has changed to introduce the notion of static imports and dynamic includes. If the tasks doing the import is using variable interpolation or conditionals then the task should be dynamic. This results in quicker playbook runs due to less importing of unneccessary tasks. One side effect of this is that child tasks of dynamic includes do not inherit their parents' tags so you must tag them explicitly or a block.
This commit is contained in:
@ -35,7 +35,7 @@
|
||||
tags: nginx
|
||||
|
||||
- name: Configure nginx virtual hosts
|
||||
import_tasks: vhosts.yml
|
||||
include_tasks: vhosts.yml
|
||||
when: nginx_vhosts is defined
|
||||
tags: nginx
|
||||
|
||||
|
Reference in New Issue
Block a user