From c03d6da8ecd3ffd225e18bd230bf006e2e80d84e Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Wed, 7 Oct 2015 12:32:28 -0700 Subject: [PATCH] Make bootstrap-ansible script compatible with RHEL This patch enables the bootstrap-ansible.sh script to also work on RHEL and other "yum" based Linux distributions. Change-Id: I3e28f4f4f09e7387c97afc219899bba1927215e8 --- scripts/bootstrap-ansible.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 1edb918885..ef42862817 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -41,7 +41,13 @@ info_block "Bootstrapping System with Ansible" ssh_key_create # Install the base packages -apt-get update && apt-get -y install git python-all python-dev curl autoconf g++ python2.7-dev +APT=`command -v apt-get` || true +YUM=`command -v yum` || true +if [[ "$APT" != "" ]]; then + apt-get update && apt-get -y install git python-all python-dev curl autoconf g++ python2.7-dev +elif [[ "$YUM" != "" ]]; then + yum check-update && yum -y install git python2 curl autoconf gcc-c++ python2-devel +fi # If the working directory exists remove it if [ -d "${ANSIBLE_WORKING_DIR}" ];then