Thanks Dan, its a good solution, but I'm kind of use (and like) passing parameters in the command line. Since all variables are in hostvars, I probably can build a custom filter to extract them (or something).
On Mon, Feb 2, 2015 at 7:07 PM, Dan Vaida <[email protected]> wrote: > I would try to go by including variables from a file with --extra-vars > "@some_file.json": > http://docs.ansible.com/playbooks_variables.html#passing-variables-on-the-command-line > Then you wouldn't need to worry about dumping playbook runtime variables > from different nesting layers. You would always have one (or more) > consistent files that you could use later to reproduce the tests. > > > On Monday, 2 February 2015 14:10:40 UTC+1, Tzach Livyatan wrote: >> >> Hi all >> I'm using Ansible playbooks to run tests on EC2. >> Most of my variables are define at group_vars/all, but I do override some >> of them using -e CLI option. >> To make the test reproducible, I want to dump all the vars into a local >> file. >> What is the idiomatic way to do so? >> >> One solution I explored was using hostvars, which do hold all the >> relevant information, but also all kind of extra info I do not need like >> localhost info. >> Is it the right path? >> How can I filter only the top level, non nested vars from it? >> >> followup question: >> How to dump the vars in a format I can later easily include to reproduce >> the test? >> >> Thanks! >> >> >> >> >> >> >> >> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/toZn7PGgEB0/unsubscribe. > To unsubscribe from this group and all its topics, 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/cc975335-ca11-464c-8792-13a48c61ace0%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/cc975335-ca11-464c-8792-13a48c61ace0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Regards @TzachL -- 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/CAGLV4VeABNwLXQ5Hwe%3Dk07vfgHOd5LDmZczCVKPL_oQZThhOpg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
