|
|
|
@ -1,51 +1,38 @@
|
|
|
|
|
# issue #309: ensure process environment is restored after a module runs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: integration/runner/environment_isolation.yml
|
|
|
|
|
hosts: test-targets
|
|
|
|
|
gather_facts: true
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
|
# Verify custom env setting is cleared out.
|
|
|
|
|
# ---
|
|
|
|
|
|
|
|
|
|
# Verify sane state first.
|
|
|
|
|
- custom_python_detect_environment:
|
|
|
|
|
- name: Verify custom env setting is cleared, control
|
|
|
|
|
custom_python_detect_environment:
|
|
|
|
|
register: out
|
|
|
|
|
- assert:
|
|
|
|
|
that: not out.env.evil_key is defined
|
|
|
|
|
fail_msg: out={{out}}
|
|
|
|
|
|
|
|
|
|
- shell: echo 'hi'
|
|
|
|
|
- name: Verify custom env setting is cleared, with evil_key
|
|
|
|
|
shell: echo 'hi'
|
|
|
|
|
environment:
|
|
|
|
|
evil_key: evil
|
|
|
|
|
|
|
|
|
|
# Verify environment was cleaned up.
|
|
|
|
|
- custom_python_detect_environment:
|
|
|
|
|
- name: Verify custom env setting is cleared, without evil_key
|
|
|
|
|
custom_python_detect_environment:
|
|
|
|
|
register: out
|
|
|
|
|
- assert:
|
|
|
|
|
that: not out.env.evil_key is defined
|
|
|
|
|
fail_msg: out={{out}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
|
# Verify non-explicit module env mutations are cleared out.
|
|
|
|
|
# ---
|
|
|
|
|
|
|
|
|
|
# Verify sane state first.
|
|
|
|
|
- custom_python_detect_environment:
|
|
|
|
|
- name: Verify non-explicit module env mutations are cleared, control
|
|
|
|
|
custom_python_detect_environment:
|
|
|
|
|
register: out
|
|
|
|
|
- assert:
|
|
|
|
|
that: not out.env.evil_key is defined
|
|
|
|
|
fail_msg: out={{out}}
|
|
|
|
|
|
|
|
|
|
- custom_python_modify_environ:
|
|
|
|
|
- name: Verify non-explicit module env mutations are cleared, mutate evil_key
|
|
|
|
|
custom_python_modify_environ:
|
|
|
|
|
key: evil_key
|
|
|
|
|
val: evil
|
|
|
|
|
|
|
|
|
|
# Verify environment was cleaned up.
|
|
|
|
|
- custom_python_detect_environment:
|
|
|
|
|
- name: Verify non-explicit module env mutations are cleared, without evil_key
|
|
|
|
|
custom_python_detect_environment:
|
|
|
|
|
register: out
|
|
|
|
|
- assert:
|
|
|
|
|
that: not out.env.evil_key is defined
|
|
|
|
|