summaryrefslogtreecommitdiffstats
path: root/examples/roles/template_lookup/tasks/main.yml
blob: db2e490199cfbdb4aeb5d21b856508784c6816ee (plain)
1
2
3
4
5
6
7
8
9
10
---
# Place tasks in a block as templates are not rendered for top-level tasks
# in roles. Specifically, in `play_children()` of src/ansiblelint/utils.py,
# tasks in blocks go through `delegate_map['block']`, while top-level tasks
# in a role is not handled by `delegate_map`.
# Ref: https://github.com/ansible/ansible-lint/blob/v5.0.12/src/ansiblelint/utils.py#L305
- block:
    - name: Bug demo
      ansible.builtin.debug:
        msg: '{{ lookup("file", "a_file") }}'