Reputation: 23824
I have the following playbook:
- hosts: localhost
tasks:
- set_fact: main_body="test_main"
- template:
src: test_src.j2
dest: /tmp/test_dest.j2
And the following Jinja template:
main ()
{
{{ include main_body }}
}
When I run the playbook I get the error:
AnsibleError: template error while templating string: expected token 'end of print statement', got 'main_body'.
How to tell Jinja to include a file, its name is stored in a previously defined fact?
Upvotes: 0
Views: 1169