I'm trying to visualize a case where hash merging would be bad: Let's you had this in your group_vars/all
foo: bar: baz zib: zab but at some point you wanted to override that completely with: foo: bar: biz If you had merging on, that would yield: foo: bar: biz zib: zab Without merging, it would yield: foo: bar:biz Is that why merging is off by default? - James On Wed, Dec 4, 2013 at 5:25 PM, Michael DeHaan <[email protected]> wrote: > There's no problem doing it either way, but you're right in that the first > requires configuring host variable merging in ansible.cfg (which is not the > standard option). > > As a result, people shouldn't really write roles for sharing that rely on > that in many cases. > > > > > On Wed, Dec 4, 2013 at 2:05 PM, James Martin <[email protected]> wrote: >> >> Is it considered bad practice to have variables in group_vars defined as >> such: >> >> >> ntp: >> server: server.foo.com >> setting: foo >> >> myapp: >> database: bar >> option: baz >> >> >> instead of : >> >> ntp_server: server.foo.com >> ntp_setting: foo >> >> myapp_database: bar >> myapp_option: baz >> >> >> It seems the first option is cleaner, but I don't believe you could >> override variables in your hosts file. Instead, you'd create a >> inventory/host_vars/myhost file to override? >> >> Thanks, >> >> James >> >> -- >> 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]. >> For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > Michael DeHaan <[email protected]> > CTO, AnsibleWorks, Inc. > http://www.ansibleworks.com/ > > -- > 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]. > For more options, visit https://groups.google.com/groups/opt_out. -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
