summaryrefslogtreecommitdiff
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:18 -0800
commit41a1fe13036d4437bd502536a6ef3d008324ae5c (patch)
treeab0d9503c3dba6684503fdd9acd45d304809cce1
parent73e6d023b804024360707821877106393784381f (diff)
downloadansible-41a1fe13036d4437bd502536a6ef3d008324ae5c.tar.gz
[stable-2.11] 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>
-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