From: Thanh Ha Date: Tue, 9 Jan 2018 01:52:05 +0000 (+0000) Subject: Revert "Bootstrap Ansible if not available" X-Git-Tag: v0.1.0~49 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F8304%2F2;p=releng%2Fcommon-packer.git Revert "Bootstrap Ansible if not available" This is not actually necessary. We need Ansible in the VM that's running the test not the VM being built. Which means the VM attached in to Jenkins needs to have Ansible installed in the first place. We just need to ensure that Jenkins is initially configured with one (which we currently have to do anyway even for the regular shell script provisioner). This reverts commit 99f875674576f3643c9713750a7017f581ff758b. Change-Id: I607526f4f6575e2a29c7184e0196e9c92040afd9 Signed-off-by: Thanh Ha --- diff --git a/provision/install-ansible.sh b/provision/install-ansible.sh deleted file mode 100644 index 12541c7..0000000 --- a/provision/install-ansible.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2018 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## -# vi: ts=4 sw=4 sts=4 et : - -# Packer Ansible provisioner needs Ansible installed so bootstrap if necessary -if ! command -v /usr/bin/ansible-playbook; then - if command -v apt; then - apt -y update - apt install -y software-properties-common - apt-add-repository -y ppa:ansible/ansible - apt install -y ansible - fi - if command -v yum; then - yum install -y ansible - fi -fi diff --git a/templates/builder.json.example b/templates/builder.json.example index de57570..c0c194d 100644 --- a/templates/builder.json.example +++ b/templates/builder.json.example @@ -40,7 +40,6 @@ { "type": "shell", "scripts": [ - "common-packer/provision/install-ansible.sh", "common-packer/provision/install-python.sh" ], "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi" diff --git a/templates/docker.json.example b/templates/docker.json.example index be38e8c..6e92844 100644 --- a/templates/docker.json.example +++ b/templates/docker.json.example @@ -40,7 +40,6 @@ { "type": "shell", "scripts": [ - "common-packer/provision/install-ansible.sh", "common-packer/provision/install-python.sh" ], "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"