How can I use the results from jinja2-templated file into a variable
without some hack to write a file out and read it in again?
I'm using the ec2 module to create new EC2 instances. For this module, you
can specify a multi-line string for the user_data field. I'd like to use a
template to create the string to use for this field. How can I do this?
The template module doesn't seem to fit because it wants to write to an
absolute destination at the target host, but I don't want to write a file,
I just need the templated output to use in a variable to pass along to the
ec2 module.
I can write the data with {{ jinja2 variables }} directly in a playbook,
but I want to re-use the same template for multiple playbooks that set up
different instances with different values.
Tried the lookup('file', 'my-user-data.yml') but it does not appear to be
parsed by jinja2.
Perhaps I'm missing something obvious...?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/67035755-77e8-4d7d-9f87-2261876f68ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.