ansible/test/integration/targets/module_utils_respawn/tasks/main.yml
Matt Davis 4c5ce5a1a9
module compat for py3.8+ controller (#73423)
* module compat for py3.8+ controller

* replaced internal usages of selinux bindings with internal ctypes binding (allows basic selinux operations from any Python interpreter), plus tests

* added new respawn_module API to allow modules to import Python packages that are only available under a well-known interpreter, plus tests

* added respawn logic to modules that need Python libs from a specific system interpreter (apt, apt_repository, dnf, yum)

minimize internal HAVE_SELINUX usage

spurious junk

pep8

* pylint fixes

* add RHEL8 Python 3.8 testing

* more pylint

* import sanity

* unit tests

* changelog update

* fix a bunch of stuff

* tweak changelog

* fix setup_rpm_repo on EL8

* misc sanity/test fixes

* misc feedback tweaks

* fix import fallback in test module

* fix selinux MU test

* fix dnf tests to avoid python-dependent test packages

* add trailing LFs to aliases

* fix yum tests to avoid test package with Python deps

* hack create_repo for EL6 to create noarch package
2021-02-10 21:32:59 -08:00

24 lines
839 B
YAML

- name: collect the default interpreter
respawnme:
mode: no_respawn
register: default_python
- name: cause a respawn
respawnme:
mode: respawn
register: respawned_python
- name: cause multiple respawns (should fail)
respawnme:
mode: multi_respawn
ignore_errors: true
register: multi_respawn
- assert:
that:
# the respawn task should report the path of the interpreter it created, and that it's running under the new interpreter
- respawned_python.created_interpreter == respawned_python.interpreter_path
# ensure that the respawned interpreter is not the same as the default
- default_python.interpreter_path != respawned_python.interpreter_path
# multiple nested respawns should fail
- multi_respawn is failed and multi_respawn.module_stderr is search('has already been respawned')