From: Aric Gardner Date: Thu, 19 Sep 2019 21:40:28 +0000 (-0400) Subject: Ansible yum_repository has includepkgs option X-Git-Tag: v0.4.0~7 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=08f2f3c4fa2389148f60c1709625b90b5008297e;p=releng%2Fcommon-packer.git Ansible yum_repository has includepkgs option 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 Change-Id: Id968757b41fe6d99f9a22bcbaf98be74b5d05e3e --- diff --git a/provision/install-base-pkgs-RedHat.yaml b/provision/install-base-pkgs-RedHat.yaml index 266c394..beacd2d 100644 --- a/provision/install-base-pkgs-RedHat.yaml +++ b/provision/install-base-pkgs-RedHat.yaml @@ -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