From: Thanh Ha Date: Fri, 12 Jun 2020 00:37:12 +0000 (-0400) Subject: Fix provisioner to install Git 2 from IUS X-Git-Tag: v0.5.2^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=3cecc412b0339d8dca5121650fbb930c00fac20c;p=releng%2Fcommon-packer.git Fix provisioner to install Git 2 from IUS While patch Ibace4cdf89d0615a2e5117f9ea3ca50730d5c93d fixed the setup for the IUS repo. It failed to ensure that Git 2 is installed from the IUS repo. In the refactored IUS repo git2u no longer exists and instead the latest Git package appears to be git224 so let's update to that version. Also class cast ansible_distribution_major_version|int as this variable normally returns a type AnsibleUnsafeText which cannot be compared to an int type. Change-Id: I1cd815fb0440be996ba66c3a48eab9d6da02f4bb Signed-off-by: Thanh Ha --- diff --git a/provision/install-base-pkgs-RedHat.yaml b/provision/install-base-pkgs-RedHat.yaml index 6a6252a..f1f593b 100644 --- a/provision/install-base-pkgs-RedHat.yaml +++ b/provision/install-base-pkgs-RedHat.yaml @@ -9,7 +9,7 @@ gpgcheck: "yes" state: present includepkgs: - - git2u* + - git2* - yum-plugin-replace become: true when: @@ -32,7 +32,7 @@ state: latest become: true -- name: Swap to git2u +- name: Swap to git224 block: - name: Install yum-plugin-replace yum: @@ -42,9 +42,9 @@ - name: Gather rpm package facts package_facts: manager: auto - - name: Replace git with git2u - command: yum replace -y git --replace-with git2u + - name: Replace git with git224 + command: yum replace -y git --replace-with git224 when: ansible_facts.packages['git'] is defined become: true when: - - ansible_distribution_major_version < 8 + - ansible_distribution_major_version|int < 8 diff --git a/releasenotes/notes/ius-git2-6bb85ed76df9cca8.yaml b/releasenotes/notes/ius-git2-6bb85ed76df9cca8.yaml new file mode 100644 index 0000000..1fee775 --- /dev/null +++ b/releasenotes/notes/ius-git2-6bb85ed76df9cca8.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fix failure to install Git 2 from the IUS repo. While the patch + https://gerrit.linuxfoundation.org/infra/c/releng/common-packer/+/62244 + sets up the IUS repo, it fails to replace git with git from the IUS repo + due to the selected package git2u being non-existant in the repo. + This update instead installs git224 from the IUS repo.