[stable-2.10] 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 27fe26edbf)

Co-authored-by: Matt Clay <matt@mystile.com>
pull/77263/head
Matt Clay 3 years ago
parent 98c41fd739
commit 0d087a95b2

@ -3,8 +3,17 @@
src: constraints.txt src: constraints.txt
dest: "{{ remote_tmp_dir }}/pexpect-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 - name: Install pexpect
pip: pip:
name: pexpect name: pexpect
extra_args: '--constraint "{{ remote_tmp_dir }}/pexpect-constraints.txt"' extra_args: '--constraint "{{ remote_tmp_dir }}/pexpect-constraints.txt"'
state: present state: present
when: pip_user is failed

Loading…
Cancel
Save