From e4de36d97b5c67cb30e885dedf0e2e17af25ac6c Mon Sep 17 00:00:00 2001 From: "tin.l.lam" Date: Fri, 24 Nov 2017 19:17:42 -0600 Subject: [PATCH] CentOS: Fix jq and pip installation This PS fixes pip and jq installation on CentOS. It also removes some duplicate code in the gate playbooks. Co-Authored-By: portdirect This patch set should fix an issue where centos cannot find python-pip in the EPEL. Change-Id: If3a437e0756a363b8cefaa9a8bdd1c3498fedbfd --- .../tasks/helm-setup-dev-environment.yaml | 54 +++++++------------ .../deploy-python-pip/tasks/main.yaml | 4 +- .../gate/playbooks/deploy-yq/tasks/main.yaml | 1 + 3 files changed, 22 insertions(+), 37 deletions(-) diff --git a/tools/gate/playbooks/deploy-helm-packages/tasks/helm-setup-dev-environment.yaml b/tools/gate/playbooks/deploy-helm-packages/tasks/helm-setup-dev-environment.yaml index d782546e3..b2bfa7d21 100644 --- a/tools/gate/playbooks/deploy-helm-packages/tasks/helm-setup-dev-environment.yaml +++ b/tools/gate/playbooks/deploy-helm-packages/tasks/helm-setup-dev-environment.yaml @@ -10,42 +10,26 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: installing OS-H dev tools - include_role: - name: deploy-package - tasks_from: dist - vars: - packages: - deb: - - git - - make - - curl - - ca-certificates - - jq - rpm: - - git - - make - - curl - - jq - - block: - - name: removing jq binary on centos - become: true - become_user: root - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' - file: - path: "{{ item }}" - state: absent - with_items: - - /usr/bin/jq - - name: installing jq 1.5 binary for centos - become: true - become_user: root - when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' - get_url: - url: https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 - dest: /usr/bin/jq - mode: 0555 + - name: installing OS-H dev tools + include_role: + name: deploy-package + tasks_from: dist + vars: + packages: + deb: + - git + - make + - curl + - ca-certificates + rpm: + - git + - make + - curl + - name: installing jq + include_role: + name: deploy-jq + tasks_from: main - name: assemble charts make: diff --git a/tools/gate/playbooks/deploy-python-pip/tasks/main.yaml b/tools/gate/playbooks/deploy-python-pip/tasks/main.yaml index 109b636eb..19cf5af98 100644 --- a/tools/gate/playbooks/deploy-python-pip/tasks/main.yaml +++ b/tools/gate/playbooks/deploy-python-pip/tasks/main.yaml @@ -27,13 +27,13 @@ state: present - name: ensuring python pip package is present for centos yum: - name: python-pip + name: python-devel state: present - name: ensuring python pip package is present for fedora via the python-devel rpm when: ansible_distribution == 'Fedora' dnf: - name: python-devel + name: python2-pip state: present - name: ensuring pip is the latest version diff --git a/tools/gate/playbooks/deploy-yq/tasks/main.yaml b/tools/gate/playbooks/deploy-yq/tasks/main.yaml index e16dbec5d..b5f8b1852 100644 --- a/tools/gate/playbooks/deploy-yq/tasks/main.yaml +++ b/tools/gate/playbooks/deploy-yq/tasks/main.yaml @@ -14,6 +14,7 @@ - block: - name: ensuring jq is deployed on host + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' or ansible_distribution == 'Fedora' include_role: name: deploy-package tasks_from: dist