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.
|
|
|
#
|
|
|
|
# Test sudo_flags respects -E.
|
|
|
|
#
|
|
|
|
|
|
|
|
- name: integration/playbook_semantics/become_flags.yml
|
|
|
|
hosts: test-targets
|
|
|
|
any_errors_fatal: true
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: "without -E"
|
|
|
|
become: true
|
|
|
|
shell: "echo $I_WAS_PRESERVED"
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that: "out.stdout == ''"
|
|
|
|
fail_msg: out={{out}}
|
|
|
|
|
|
|
|
- hosts: test-targets
|
|
|
|
any_errors_fatal: true
|
|
|
|
become_flags: -E
|
|
|
|
tasks:
|
|
|
|
- name: "with -E"
|
|
|
|
become: true
|
|
|
|
shell: "echo $I_WAS_PRESERVED"
|
|
|
|
register: out2
|
|
|
|
environment:
|
|
|
|
I_WAS_PRESERVED: 2
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that: "out2.stdout == '2'"
|
|
|
|
fail_msg: out={{out}}
|