Fix provisioner to install Git 2 from IUS 61/64261/2 v0.5.2
authorThanh Ha <zxiiro@gmail.com>
Fri, 12 Jun 2020 00:37:12 +0000 (20:37 -0400)
committerThanh Ha <zxiiro@gmail.com>
Fri, 12 Jun 2020 14:11:12 +0000 (10:11 -0400)
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 <zxiiro@gmail.com>
provision/install-base-pkgs-RedHat.yaml
releasenotes/notes/ius-git2-6bb85ed76df9cca8.yaml [new file with mode: 0644]

index 6a6252a..f1f593b 100644 (file)
@@ -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 (file)
index 0000000..1fee775
--- /dev/null
@@ -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.