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 <
bc...@ansible.com> wrote:
>>
>> yes, you need to gather facts before that variable is available, you might want to use |default filter to avoid the error
> ansible_become_method: "{{
> (ansible_distribution_release|version_compare('5.8',
> '>='))|ternary('doas', 'sudo') }}"
I think Brian meant something like this:
ansible_become_method: "{{
(ansible_distribution_release|version_compare('5.8',
> '>='))|ternary('doas', 'sudo')|default(sudo) }}"
This way, when ansible_distribution_release is undefined, the
default(sudo) strikes and sets a default. Once
ansible_distribution_release is defined, default does nothing anymore.
Johannes