Reputation: 1606
I'm sending a REST API query using Ansible uri
module. The body content is picked up from a file:
body: "{{ lookup('file',mp_config_path + item.file) }}"
There are some variables in my file - is it possible to tell ansible to run Jinja2 filters on it before sending it to the uri
module?
Upvotes: 0
Views: 1381
Reputation: 68469
And how about using template
lookup?
body: "{{ lookup('template',mp_config_path + item.file) }}"
or:
- uri:
body: "{{ item }}"
# other parameters
with_template: "{{ mp_config_path + item.file }}"
Upvotes: 2