Fix Py2 install detection and trim py2 package removals

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-11-26 12:57:10 -08:00
parent f7dcf020fb
commit 56d689d31a
4 changed files with 47 additions and 17 deletions

View file

@ -51,7 +51,7 @@
- name: Install required packages (Python 3)
dnf:
name: ['python2-pip', 'python3-fedfind', 'python3-fedmsg', 'python3-openqa_client',
name: ['python3-fedfind', 'python3-fedmsg', 'python3-openqa_client',
'python3-setuptools', 'python3-six']
state: present
when: "'python34-fedmsg' in group_names"
@ -81,6 +81,14 @@
notify:
- restart fedmsg-hub
- name: Install python2-pip if needed to remove py2 check-compose
dnf:
name: python2-pip
state: present
when: "py2ccinstalled is defined and py2ccinstalled.files and 'python34-fedmsg' in group_names"
tags:
- packages
- name: Remove check-compose (Python 2)
command: "pip2 uninstall --disable-pip-version-check --yes check-compose"
when: "py2ccinstalled is defined and py2ccinstalled.files and 'python34-fedmsg' in group_names"
@ -104,8 +112,7 @@
- name: Remove Python 2 packages
dnf:
name: ['python2-fedfind', 'python2-fedmsg', 'python2-openqa_client',
'python2-setuptools', 'python2-six']
name: ['python2-fedfind', 'python2-fedmsg', 'python2-openqa_client']
state: absent
when: "'python34-fedmsg' in group_names"
tags: