I'm trying to figure out how to emit a configuration file for jmxtrans. The config is json, the values I need to fill in are known by ansible, but I'm having a hell of a time building up the dict structure and dumping to json using the template module's to_json filter.
The simple explanation is that I'd like to loop over a list of servers from an inventory group, copy a few dictionaries from a vars file thereby building up a completely new dict and then dump that to a json file that jmxtrans uses for configuration. If I had a way to turn on extension, I could do all of this in jinja2: https://gist.github.com/davidbirdsong/9355702 I keep needing to be able to turn on extensions and take that as an indicator that I'm doing it the wrong way. Perhaps I am? Is there a more ansible-native way to loop on data and create new structures at play-time? Here's my vars.yml file: https://gist.github.com/davidbirdsong/9355770 -- 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/3a9d73c5-88ef-4afc-b55c-2b8330dba5c3%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
