summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2022-02-28 12:22:46 -0800
committerMatt Clay <matt@mystile.com>2022-02-28 14:38:29 -0800
commitbe8c20f6751b378899c8e87a5c6212f9a406e20e (patch)
treea1e66a01a46bb675c3e15ef3ddd14d1e5139bd23 /test
parent5c2df6ebf96ba4a6fa02e18b4d9b1f8b0da32cb4 (diff)
downloadansible-be8c20f6751b378899c8e87a5c6212f9a406e20e.tar.gz
[stable-2.9] Update setup_pexpect to prefer pip user installs.
This works around issues on RHEL 7.9 when an old version of pexpect is installed from an OS package. (cherry picked from commit 27fe26edbf57a39a11de7dea14dc60d4a6b1384e) Co-authored-by: Matt Clay <matt@mystile.com>
Diffstat (limited to 'test')
-rw-r--r--test/integration/targets/setup_pexpect/tasks/main.yml9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/integration/targets/setup_pexpect/tasks/main.yml b/test/integration/targets/setup_pexpect/tasks/main.yml
index 690fe44152..84b7bd1ca7 100644
--- a/test/integration/targets/setup_pexpect/tasks/main.yml
+++ b/test/integration/targets/setup_pexpect/tasks/main.yml
@@ -3,8 +3,17 @@
src: constraints.txt
dest: "{{ remote_tmp_dir }}/pexpect-constraints.txt"
+- name: Install pexpect with --user
+ pip:
+ name: pexpect
+ extra_args: '--user --constraint "{{ remote_tmp_dir }}/pexpect-constraints.txt"'
+ state: present
+ ignore_errors: yes # fails when inside a virtual environment
+ register: pip_user
+
- name: Install pexpect
pip:
name: pexpect
extra_args: '--constraint "{{ remote_tmp_dir }}/pexpect-constraints.txt"'
state: present
+ when: pip_user is failed