roles/nginx: Use dynamic include_tasks for Let's Encrypt

Use dynamic includes instead of static imports when you are running
tasks conditionally or using variable interpolation. The down side
is that you need to then tag the parent task as well as all child
tasks, as tags only apply to children of statically imported tasks.
This commit is contained in:
2018-04-25 20:03:32 +03:00
parent ebda406de3
commit e50f413f5e
2 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@
loop: "{{ nginx_vhosts }}"
tags: wordpress
- import_tasks: letsencrypt.yml
- include_tasks: letsencrypt.yml
when: use_letsencrypt is defined and use_letsencrypt == True
tags: letsencrypt