From 49b8babff7bc2b1bdbd7ae56e61d3eac73f23165 Mon Sep 17 00:00:00 2001 From: Andrew Grimberg Date: Tue, 26 Jun 2018 13:22:31 -0700 Subject: [PATCH] Properly install git2u on EL systems 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 --- provision/baseline.yaml | 5 ----- provision/install-base-pkgs-RedHat.yaml | 30 +++++++++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/provision/baseline.yaml b/provision/baseline.yaml index ea2a56a..1d4f70e 100644 --- a/provision/baseline.yaml +++ b/provision/baseline.yaml @@ -12,11 +12,6 @@ - '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 diff --git a/provision/install-base-pkgs-RedHat.yaml b/provision/install-base-pkgs-RedHat.yaml index 1cdc42f..29cdc3b 100644 --- a/provision/install-base-pkgs-RedHat.yaml +++ b/provision/install-base-pkgs-RedHat.yaml @@ -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 -- 2.16.6