Ansible yum_repository has includepkgs option 91/61791/1
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 19 Sep 2019 21:40:28 +0000 (17:40 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Thu, 19 Sep 2019 21:40:28 +0000 (17:40 -0400)
Limit IUS repo ro git2u and yum replace plugin
Something about the order of the yum package install
causes yum to try to pull down python36u

This can be reproduced in docker with
https://gist.github.com/Aricg/73a872fcaaa5eae1302d71eb2237d208

ISSUE: IT-17631
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: Id968757b41fe6d99f9a22bcbaf98be74b5d05e3e

provision/install-base-pkgs-RedHat.yaml

index 266c394..beacd2d 100644 (file)
@@ -1,4 +1,18 @@
 ---
+- name: Add IUS repository to /etc/yum.repos.d/
+  yum_repository:
+    name: ius
+    description: IUS Community Packages for Enterprise Linux
+    mirrorlist: https://mirrors.iuscommunity.org/mirrorlist?repo=ius-{{ ansible_distribution|lower}}{{ ansible_distribution_major_version|lower }}&arch=$basearch&protocol=http
+    gpgkey: http://dl.iuscommunity.org/pub/ius/IUS-COMMUNITY-GPG-KEY
+    enabled: "yes"
+    gpgcheck: "yes"
+    priority: 15
+    state: present
+    includepkgs:
+      - git2u*
+      - yum-plugin-replace
+
 - name: Install base packages
   yum:
     name:
@@ -6,17 +20,9 @@
       - "@development"
       - yum-utils
       - https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
-      - https://centos7.iuscommunity.org/ius-release.rpm
     state: latest
   become: true
 
-- name: Only use IUS for git2u
-  lineinfile:
-    path: /etc/yum.repos.d/ius.repo
-    line: "includepkgs=git2u*,yum-plugin-replace"
-    insertafter: "gpgkey.*"
-  become: true
-
 - name: Swap to git2u
   block:
     - name: Install yum-plugin-replace