Properly install git2u on EL systems 61/11561/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 26 Jun 2018 20:22:31 +0000 (13:22 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 26 Jun 2018 20:22:31 +0000 (13:22 -0700)
git2u needs special handling (yum-plugin-replace) for installation. Make
sure that all steps happen in the correct order

Change-Id: I6c6b5a49031463e02442f3ea8f50f5aea37e4a3d
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
provision/baseline.yaml
provision/install-base-pkgs-RedHat.yaml

index ea2a56a..1d4f70e 100644 (file)
         - 'install-base-pkgs-{{ansible_distribution}}.yaml'
         - 'install-base-pkgs-{{ansible_os_family}}.yaml'
 
-    - name: Switch to git2u
-      shell: yum -y replace git --replace-with git2u
-      when: ansible_os_family == 'RedHat'
-      become: yes
-
     - name: Allow jenkins user sudo access
       copy:
         dest: /etc/sudoers.d/89-jenkins-user-defaults
index 1cdc42f..29cdc3b 100644 (file)
@@ -1,16 +1,24 @@
 ---
 - name: Install base packages
   yum:
-    name: '{{pkg}}'
+    name:
+      - '@base'
+      - '@development'
+      - yum-utils
+      - https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+      - https://centos7.iuscommunity.org/ius-release.rpm
     state: latest
-  with_items:
-    - '@base'
-    - '@development'
-    - yum-utils
-    - https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
-    - https://centos7.iuscommunity.org/ius-release.rpm
-    # yum-plugin-replace comes from ius
-    - yum-plugin-replace
-  loop_control:
-    loop_var: pkg
+  become: yes
+
+# yum-plugin-replace comes from ius and therefore must be a separate step
+- name: Install yum-plugin-replace
+  yum:
+    name: yum-plugin-replace
+    state: latest
+    update_cache: yes
+  become: yes
+
+# calling yum replace is not possible via standard ansible
+- name: Switch to git2u
+  shell: yum -y replace git --replace-with git2u
   become: yes