Variable substitution while file lookup

12 views
Skip to first unread message

ankur...@gmail.com

unread,
Oct 13, 2016, 9:03:41 AM10/13/16
to Ansible Project
Hi,

I am loading a file using lookup eg "{{ lookup('file', 'cluster_policies.json') | from_json }}"

Now my file cluster_policies.json contains some ansible variables that I need to substitute. Any idea how can it be done?

Thanks

ankur...@gmail.com

unread,
Oct 13, 2016, 9:33:16 AM10/13/16
to Ansible Project
Ok i found an answer.
 {{ lookup('template', 'cluster_policies.j2') }}
this works fine
Reply all
Reply to author
Forward
0 new messages