Re: [ansible-project] Group variables conditional based on OS distribution release

2016-03-07 Thread Johannes Kastl
Hi Darren, Am 07.03.16 schrieb Darren S.: > I'm still finding myself stumped on this. See my answer below. > On Mon, Feb 29, 2016 at 10:29 PM, Brian Coca wrote: >> >> yes, you need to gather facts before that variable is available, you might >> want to use |default filter

Re: [ansible-project] Group variables conditional based on OS distribution release

2016-03-06 Thread Darren S.
I'm still finding myself stumped on this. On Mon, Feb 29, 2016 at 10:29 PM, Brian Coca wrote: > > yes, you need to gather facts before that variable is available, you might > want to use |default filter to avoid the error If the variable ansible_distribution_release is used

Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-29 Thread Brian Coca
yes, you need to gather facts before that variable is available, you might want to use |default filter to avoid the error -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-27 Thread Darren S.
On Fri, Feb 26, 2016 at 11:10 PM, Brian Coca wrote: > ​Y​ > ou cannot use jinja2 commands in vars file, the templates are not used in > the vars file, they are just assigned as strings that later get recognized > as templates and templated. But you can do this: > >

Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-27 Thread Josh Smift
We do stuff with inventory variales and dicts, like become_method: 5.7: doas 5.8: doas 6.0: sudo ansible_become_method: become_method[ansible_distribution_release] You can't do the >= thing this way, you have to enumerate all the options. (Or you could have a default and only

Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-26 Thread Brian Coca
​Y​ ou cannot use jinja2 commands in vars file, the templates are not used in the vars file, they are just assigned as strings that later get recognized as templates and templated. But you can do this: ansible_become_method: "{{ (ansible_distribution_release|version_compare('5.8',

[ansible-project] Group variables conditional based on OS distribution release

2016-02-26 Thread Darren S.
Hi, After various docs and some trial and error, I can't figure out how to handle setting a variable differently when the target operating system version is newer than a certain release. OpenBSD 5.8 and newer have replaced sudo(8) with doas(1), so I'd like to set ansible_become_method correctly