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.
31 lines
601 B
YAML
31 lines
601 B
YAML
# Verify passwordless sudo behaviour in various cases.
|
|
|
|
- name: integration/become/sudo_nopassword.yml
|
|
hosts: test-targets
|
|
tasks:
|
|
|
|
- name: Verify we aren't root
|
|
shell: whoami
|
|
register: out
|
|
|
|
- assert:
|
|
that:
|
|
- out.stdout != 'root'
|
|
fail_msg: |
|
|
out={{ out }}
|
|
|
|
- name: Ensure passwordless sudo to root succeeds.
|
|
shell: whoami
|
|
become: true
|
|
become_user: root
|
|
register: out
|
|
|
|
- assert:
|
|
that:
|
|
- out.stdout == 'root'
|
|
fail_msg: |
|
|
out={{ out }}
|
|
tags:
|
|
- sudo
|
|
- sudo_nopassword
|