mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-03-20 03:57:02 +08:00
openqa etc: reinstall local Python libs when Python ver changes
In openqa/dispatcher, relvalconsumer and check-compose roles, we install Python libraries from git checkouts (these are things we don't really want to package as they change too much). This enhances those roles so that we check whether pip considers the libraries to be installed, and install them if it doesn't. The purpose is to catch when the Python version rolls over on system upgrade, and reinstall the libraries in that case - I got bitten by this when upgrading to F32, I forgot to reinstall these libs for Python 3.8, and it broke things for a couple of days before I noticed and fixed it manually... Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
# 'relval' itself is needed as we call it directly for size
|
||||
# checking
|
||||
name: ['python3-fedfind', 'python3-wikitcms', 'fedora-messaging',
|
||||
'python3-mwclient', 'python3-setuptools', 'relval']
|
||||
'python3-mwclient', 'python3-pip', 'python3-setuptools', 'relval']
|
||||
state: present
|
||||
tags:
|
||||
- packages
|
||||
@@ -140,11 +140,18 @@
|
||||
dest: /root/relvalconsumer
|
||||
register: gitrvc
|
||||
|
||||
- name: Check if relvalconsumer is installed for current Python
|
||||
command: "pip show relvalconsumer"
|
||||
register: instrvc
|
||||
changed_when: "1 != 1"
|
||||
failed_when: "1 != 1"
|
||||
check_mode: no
|
||||
|
||||
- name: Install relvalconsumer
|
||||
command: "python3 setup.py install --nodeps"
|
||||
args:
|
||||
chdir: /root/relvalconsumer
|
||||
when: "gitrvc is changed"
|
||||
when: "gitrvc is changed or instrvc.rc != 0"
|
||||
notify:
|
||||
- restart relvalconsumer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user