27 lines
520 B
YAML
27 lines
520 B
YAML
# Verify passwordless sudo behaviour in various cases.
|
|
|
|
- hosts: all
|
|
any_errors_fatal: true
|
|
tasks:
|
|
- name: integration/become/sudo_basic.yml
|
|
assert:
|
|
that: true
|
|
|
|
- name: Verify we aren't root
|
|
shell: whoami
|
|
register: out
|
|
|
|
- assert:
|
|
that:
|
|
- out.stdout != 'root'
|
|
|
|
- name: Ensure passwordless sudo to root succeeds.
|
|
shell: whoami
|
|
become: true
|
|
become_user: root
|
|
register: out
|
|
|
|
- assert:
|
|
that:
|
|
- out.stdout == 'root'
|