diff --git a/test/integration/targets/setup_libxcrypt/tasks/main.yml b/test/integration/targets/setup_libxcrypt/tasks/main.yml index 40f488dcee7..0b193703a8f 100644 --- a/test/integration/targets/setup_libxcrypt/tasks/main.yml +++ b/test/integration/targets/setup_libxcrypt/tasks/main.yml @@ -35,5 +35,8 @@ notify: libxcrypt was installed become: yes become_user: "{{ brew_stat.stat.pw_name }}" + vars: + # Avoid using the current interpreter, which may be from a venv that the become user has no access to. + ansible_python_interpreter: "{{ lookup('env', 'ANSIBLE_TEST_PYTHON_INTERPRETER') }}" environment: HOMEBREW_NO_AUTO_UPDATE: True diff --git a/test/integration/targets/setup_libxcrypt/tasks/uninstall.yml b/test/integration/targets/setup_libxcrypt/tasks/uninstall.yml index 8f73d56dc6a..09817e7e201 100644 --- a/test/integration/targets/setup_libxcrypt/tasks/uninstall.yml +++ b/test/integration/targets/setup_libxcrypt/tasks/uninstall.yml @@ -32,5 +32,8 @@ command: brew uninstall libxcrypt become: yes become_user: "{{ brew_stat.stat.pw_name }}" + vars: + # Avoid using the current interpreter, which may be from a venv that the become user has no access to. + ansible_python_interpreter: "{{ lookup('env', 'ANSIBLE_TEST_PYTHON_INTERPRETER') }}" environment: HOMEBREW_NO_AUTO_UPDATE: True