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.
30 lines
499 B
YAML
30 lines
499 B
YAML
7 years ago
|
# This must be run with FOO=2 set in the environment.
|
||
|
|
||
|
#
|
||
|
# Test sudo_flags respects -E.
|
||
|
#
|
||
|
|
||
|
- hosts: all
|
||
7 years ago
|
any_errors_fatal: true
|
||
7 years ago
|
tasks:
|
||
|
- name: "without -E"
|
||
|
become: true
|
||
|
shell: "echo $FOO"
|
||
|
register: out
|
||
|
|
||
|
- assert:
|
||
|
that: "out.stdout == ''"
|
||
|
|
||
|
- hosts: all
|
||
7 years ago
|
any_errors_fatal: true
|
||
7 years ago
|
become_flags: -E
|
||
|
tasks:
|
||
|
- name: "with -E"
|
||
|
become: true
|
||
|
shell: "set"
|
||
|
register: out2
|
||
|
|
||
|
- debug: msg={{out2}}
|
||
|
- assert:
|
||
|
that: "out2.stdout == '2'"
|