Kind of works:
- name: test playbook
hosts: 127.0.0.1
connection: local
gather_facts: no
vars:
- somevar: {'a': 1}
- anothervar: {'b': 2}
tasks:
- debug: msg="{{ somevar.update(anothervar) }}{{ somevar }}"
But it is desireable to have merge_dicts filter for that.
On 17.05.2014 16:57, Dick Davies wrote:
Thanks, I gave up and went with a shell script due to time pressures,
but will bookmark this approach for next time :)
On 10 May 2014 01:00, Michael DeHaan <[email protected]> wrote:
You may be able to try this directly in Jinja2.
Warning: NOT TESTED
environment: "{{ base_env.update(my_env) }}"
On Wed, May 7, 2014 at 2:34 PM, Dick Davies <[email protected]> wrote:
Thanks Serge
trouble is i need the replace behaviour elsewhere in the play >_<
Looks like I'll have to do a tactical dirty hack with set_fact and
inline jinja2 or something.
On 7 May 2014 18:15, Serge van Ginderachter <[email protected]>
wrote:
On 7 May 2014 18:53, Dick Davies <[email protected]> wrote:
does anyone know if I can merge these dicts in Ansible ? this is within
a
role if that makes any difference.
You can, but it's general config only, so all or nothing:
$ grep merge ansible.cfg
# hash can be merged, or replaced
hash_behaviour=merge
Serge
--
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/CAEhzMJB%3DOFn6zu-75FRxw%3Dric4WttfK0Gzous5cK_Gwi%3DyfCmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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/CAK5eLPTTD4Mqom0mZH-h-0ZGGGGfnAbT%2BhU9UjmqyrsFWfkjdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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/CA%2BnsWgzZmEY%3DdCu2xXx521LdvB9w9TRMQ9JENi0Z8Uaruhm11Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - [email protected]
--
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/537C74B4.5040407%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.