I use group_vars a lot and it's fine to do so. It is useful for declaring something like a constant though, to save typing, or make things configured in one specific place.
(It keeps configuration of that thing with the playbook vs the inventory) On Wed, Dec 3, 2014 at 5:55 PM, Matt Hughes <[email protected]> wrote: > Ah thanks, that makes more sense. > > I’m not sure why I’d ever want to use vars/ then. Sure I could be > convinced of a use-case, but it seems much more natural for > inventory/group/host vars to override anything defined in a role, but I see > this discussion has taken place before. :) > > > > > > On December 3, 2014 at 5:54:20 PM, Michael Peters ( > [email protected]) wrote: > > Put it into the role's defaults (roles/foo/defaults/main.yml). Those > are the ones that are really meant to be overridden. > > On Wed, Dec 3, 2014 at 5:49 PM, Matt Hughes <[email protected]> > wrote: > > I have a role defined with: > > > > - hosts: elk > > sudo: true > > vars: > > es_heap: 8G > > > > > > I run that role against a given inventory that attempts to override that > > variable: > > > > [elk] > > node1 es_heap=2G > > > > [elk:vars] > > es_heap=2G > > > > Tried overriding with both host and group vars, but I keep getting the > role > > variable. Aren't the former supposed to override the latter? I also > tried > > moving the variable from the role in /vars/main.yml, but that had no > effect. > > I must be missing something, because having host variable override role > > variable seems pretty basic. > > > > -- > > 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/12a0601b-3d75-40c3-8c1c-3c7476cbcf82%40googlegroups.com. > > > For more options, visit https://groups.google.com/d/optout. > > -- > 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/63PKx3Lxb4U/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/CAJQqANfj0tOgaFU8rzojYNOCK6W%2B%3DYZxSDqVXwy2UO7M%3D4q_Qg%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/etPan.547f94e8.7545e146.174f%40Matthews-MacBook-Pro.local > <https://groups.google.com/d/msgid/ansible-project/etPan.547f94e8.7545e146.174f%40Matthews-MacBook-Pro.local?utm_medium=email&utm_source=footer> > . > > 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%2BnsWgyTakMcLD%2BNsUegtrZY%3D3unn2tWVjVHfauYAjZ-qGsZKg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
