I'm a little confused by this because you seem to be saying a feature isn't supported that is actually part of Ansible, but it's actually a module already in Ansible:
http://docs.ansible.com/include_vars_module.html It also works with the "when" operator for per-OS variant usage. Were you perhaps reading an old thread talking about a language feature when it didn't exist? Sorry for confusion... On Mon, Apr 28, 2014 at 6:01 PM, Matt Willsher <[email protected]> wrote: > Hi, > > I'm trying to write generic roles for particular applications and keep > hitting across the same problem: > > I want to set role default based on the operating system or other facts, > like include_vars, but this doesn't appear to be supported. > > The only option I see practically available for template is to use the > template logic to handle defaults, but that, while flexible, is not as > elegant as being able to set by-fact defaults. > > The code I'm working at present on is > https://github.com/WillsherPartners/ansible-sshd , where there is a large > set of defaults and a template. sshd_subsystem_sftp varies depending on > OS, but I still want to give the person using the role to option to > override the value if they see fit. > > Are there any plans for include_vars: (include_defaults?) functionality in > Ansible, or is there some other way to tackle per-os defaults? > > > Thanks, > Matt > > > -- > 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/afaeac27-07cf-4e10-8504-ade22c361540%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/afaeac27-07cf-4e10-8504-ade22c361540%40googlegroups.com?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%2BnsWgwr3ukLhnDdS9%3DZjM%3D1MPVte1D4H2RAbx_h%2BmkjJiDChg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
