|
|
@ -1,4 +1,5 @@
|
|
|
|
# related: issue #511, #536
|
|
|
|
# related: issue #511, #536
|
|
|
|
|
|
|
|
# Each case is followed by mitogen_via= case to test hostvars method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# When no ansible_python_interpreter is set, executor/module_common.py chooses
|
|
|
|
# When no ansible_python_interpreter is set, executor/module_common.py chooses
|
|
|
@ -6,57 +7,118 @@
|
|
|
|
- name: integration/transport_config/python_path.yml
|
|
|
|
- name: integration/transport_config/python_path.yml
|
|
|
|
hosts: tc-python-path-unset
|
|
|
|
hosts: tc-python-path-unset
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
when: not is_mitogen
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
- mitogen_get_stack:
|
|
|
|
register: out
|
|
|
|
register: out
|
|
|
|
- assert_equal:
|
|
|
|
- assert_equal:
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: tc-python-path-hostvar
|
|
|
|
|
|
|
|
vars: {mitogen_via: tc-python-path-unset}
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[1].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/hostvar/path/to/python"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Non-localhost with explicit ansible_python_interpreter
|
|
|
|
# Non-localhost with explicit ansible_python_interpreter
|
|
|
|
- hosts: tc-python-path-hostvar
|
|
|
|
- hosts: tc-python-path-hostvar
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
when: not is_mitogen
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
- mitogen_get_stack:
|
|
|
|
register: out
|
|
|
|
register: out
|
|
|
|
- assert_equal:
|
|
|
|
- assert_equal:
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
right: [/hostvar/path/to/python]
|
|
|
|
right: [/hostvar/path/to/python]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: tc-python-path-unset
|
|
|
|
|
|
|
|
vars: {mitogen_via: tc-python-path-hostvar}
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/hostvar/path/to/python"]
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[1].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Implicit localhost gets ansible_python_interpreter=virtualenv interpreter
|
|
|
|
# Implicit localhost gets ansible_python_interpreter=virtualenv interpreter
|
|
|
|
- hosts: localhost
|
|
|
|
- hosts: localhost
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
when: not is_mitogen
|
|
|
|
- mitogen_get_stack:
|
|
|
|
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["{{ansible_playbook_python}}"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: tc-python-path-unset
|
|
|
|
|
|
|
|
vars: {mitogen_via: localhost}
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
- mitogen_get_stack:
|
|
|
|
- mitogen_get_stack:
|
|
|
|
register: out
|
|
|
|
register: out
|
|
|
|
- assert_equal:
|
|
|
|
- assert_equal:
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
right: ["{{ansible_playbook_python}}"]
|
|
|
|
right: ["{{ansible_playbook_python}}"]
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[1].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# explicit local connections get the same treatment as everything else.
|
|
|
|
# explicit local connections get the same treatment as everything else.
|
|
|
|
- hosts: tc-python-path-local-unset
|
|
|
|
- hosts: tc-python-path-local-unset
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
when: not is_mitogen
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
- mitogen_get_stack:
|
|
|
|
register: out
|
|
|
|
register: out
|
|
|
|
- assert_equal:
|
|
|
|
- assert_equal:
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: localhost
|
|
|
|
|
|
|
|
vars: {mitogen_via: tc-python-path-local-unset}
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/usr/bin/python"]
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[1].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["{{ansible_playbook_python}}"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# explicit local connection with explicit interpreter
|
|
|
|
- hosts: tc-python-path-local-explicit
|
|
|
|
- hosts: tc-python-path-local-explicit
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- meta: end_play
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
when: not is_mitogen
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
- mitogen_get_stack:
|
|
|
|
register: out
|
|
|
|
register: out
|
|
|
|
- assert_equal:
|
|
|
|
- assert_equal:
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
right: ["/a/b/c"]
|
|
|
|
right: ["/a/b/c"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- hosts: localhost
|
|
|
|
|
|
|
|
vars: {mitogen_via: tc-python-path-local-explicit}
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- include: ../_mitogen_only.yml
|
|
|
|
|
|
|
|
- mitogen_get_stack:
|
|
|
|
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[0].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["/a/b/c"]
|
|
|
|
|
|
|
|
- assert_equal:
|
|
|
|
|
|
|
|
left: out.result[1].kwargs.python_path
|
|
|
|
|
|
|
|
right: ["{{ansible_playbook_python}}"]
|
|
|
|