2018-04-02 07:05:37 +00:00
|
|
|
#
|
|
|
|
# Test sudo_flags respects -E.
|
|
|
|
#
|
|
|
|
|
|
|
|
- hosts: all
|
2018-04-04 23:11:29 +00:00
|
|
|
any_errors_fatal: true
|
2018-04-02 07:05:37 +00:00
|
|
|
tasks:
|
2018-04-05 16:42:43 +00:00
|
|
|
- name: integration/playbook_semantics/become_flags.yml
|
|
|
|
assert:
|
|
|
|
that: true
|
|
|
|
|
2018-04-02 07:05:37 +00:00
|
|
|
- name: "without -E"
|
|
|
|
become: true
|
|
|
|
shell: "echo $FOO"
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that: "out.stdout == ''"
|
|
|
|
|
|
|
|
- hosts: all
|
2018-04-04 23:11:29 +00:00
|
|
|
any_errors_fatal: true
|
2018-04-02 07:05:37 +00:00
|
|
|
become_flags: -E
|
|
|
|
tasks:
|
|
|
|
- name: "with -E"
|
|
|
|
become: true
|
2018-04-05 16:42:43 +00:00
|
|
|
shell: "echo $FOO"
|
2018-04-02 07:05:37 +00:00
|
|
|
register: out2
|
2018-04-05 16:42:43 +00:00
|
|
|
environment:
|
|
|
|
FOO: 2
|
2018-04-02 07:05:37 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that: "out2.stdout == '2'"
|