Opened 3 months ago

Closed 3 months ago

#13529 closed Patch - Feature (Fixed)

Feature patch - Ansible - adjust python requirements for fedora (prep for centos8)

Reported by: Gary Buhrmaster Owned by: Stuart Auchterlonie
Priority: minor Milestone: 31.0
Component: Ansible Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This patch adjusts the python requirements for fedora (in prep for centos8 python requirements) by making the various required python2/3 modules explicit for each legacy releases.

The patch is somewhat ugly (blame diff). I recommend looking at the resulting file (it is much easy to look at).

Lightly tested with F30, F31.

Note that there is a bug with ansible and F30 (upstream issue), where if you have python-unversioned-command (or equivalent) installed, ansible will try to install python2-dnf, which is not available in F30. There is a fix being worked in ansible (I think targeted for 2.12?)

diff --git a/roles/mythtv-dnf/tasks/main.yml b/roles/mythtv-dnf/tasks/main.yml
index e87b05d..1b43169 100644
--- a/roles/mythtv-dnf/tasks/main.yml
+++ b/roles/mythtv-dnf/tasks/main.yml
@@ -85,7 +85,8 @@
       - libcec-devel
   when: ansible_distribution == "Fedora"
 
-- name: add mythtv essential python modules
+# Adjust for various python package renamings/availability in Fedora
+- name: add mythtv essential python modules - Fedora <30
   set_fact:
     dnf_pkg_lst:
       - '{{ dnf_pkg_lst }}'
@@ -93,42 +94,36 @@
       - python-lxml
       - python-urlgrabber
       - python2-requests
-
-- name: add mythtv essential python modules - Fedora only
-  set_fact:
-    dnf_pkg_lst:
-      - '{{ dnf_pkg_lst }}'
       - python-oauth
-  when: ansible_distribution == "Fedora"
-
-# Packages renamed in f30
-# python-requests-cache -> python2-requests-cache
-- name: add mythtv essential python modules - Fedora <30
-  set_fact:
-    dnf_pkg_lst:
-      - '{{ dnf_pkg_lst }}'
       - python-requests-cache
+      - python-libselinux
+      - python2-future
   when: ansible_distribution == "Fedora" and ansible_distribution_version|int < 30
 
-- name: add mythtv essential python modules - Fedora 30,31
+- name: add mythtv essential python2 modules - Fedora 30
   set_fact:
     dnf_pkg_lst:
       - '{{ dnf_pkg_lst }}'
-      - python2-requests-cache
-  when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 30 and ansible_distribution_version|int < 32
+      - python2-libselinux
+      - python2-future
+      - python2-oauth
+  when: ansible_distribution == "Fedora" and ansible_distribution_version|int == 30
 
-- name: add mythtv essential python modules - Fedora <31
+- name: add mythtv essential python2 modules - Fedora 30,31
   set_fact:
     dnf_pkg_lst:
       - '{{ dnf_pkg_lst }}'
-      - libselinux-python
-      - python2-future
-  when: ansible_distribution == "Fedora" and ansible_distribution_version|int < 31
+      - python2-mysql
+      - python2-lxml
+      - python2-urlgrabber
+      - python2-requests-cache
+  when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 30 and ansible_distribution_version|int < 32
 
 - name: add mythtv essential python3 modules - Fedora 30+
   set_fact:
     dnf_pkg_lst:
       - '{{ dnf_pkg_lst }}'
+      - python3-lxml
       - python3-libselinux
       - python3-future
       - python3-mysql

Change History (2)

comment:1 Changed 3 months ago by Stuart Auchterlonie

Milestone: needs_triage31.0
Status: newaccepted

comment:2 Changed 3 months ago by Stuart Auchterlonie

Resolution: Fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.