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 based on the OS version. The only idea I could come up with was
this template logic in /etc/ansible/group_vars/openbsd, which is clearly
incorrect:

{% if {{ ansible_distribution_release | version_compare('5.8', '>=') }} %}
    ansible_become_method: doas
{% else %}
    ansible_become_method: sudo
{% endif %}

What is the correct/cleanest way to ansible_become_method conditionally for
a given OS family based on the value of ansible_distribution_release?

Ansible manager: ansible 2.0.1.0 on OpenBSD 5.7

Managed nodes: OpenBSD 5.7, OpenBSD 5.8, various Linux

Thanks,

-- 
Darren Spruell
[email protected]

-- 
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/CAKVSOJUx-%3DfcKY5%2B43PA1QxMW9WrkF8Ls_NUnuOomLcJ_wiUNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to