You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/integration/stub_connections/_end_play_if_not_sudo_linux...

18 lines
418 B
YAML

# End the play if we're not on Linux and a raw 'sudo' command isn't available.
# Expects connection:local
- shell: uname -s
register: out
- meta: end_play
when: out.stdout != 'Linux'
- command: sudo -n whoami
args:
warn: "{{ False if ansible_version.full is version('2.10', '<=', strict=True) else omit }}"
ignore_errors: true
register: sudo_available
- meta: end_play
when: sudo_available.rc != 0