Sha256: 11dcbecea17fde15a5816b85aa6e683f2e2a0b211292d1dfb469a57e71f10e08

Contents?: true

Size: 1.31 KB

Versions: 19

Compression:

Stored size: 1.31 KB

Contents

function install_chef {

local INSTALL_TYPE=${1:-"CLIENT"} # CLIENT/SERVER

# cached RPMs from ELFF
local CDN_BASE="http://c2521002.cdn.cloudfiles.rackspacecloud.com"

local RH_RELEASE=$(cat /etc/redhat-release)
local TARBALL="chef-client-0.9.8-centos5.4-x86_64.tar.gz"

if [ "$RH_RELEASE" == "CentOS release 5.5 (Final)" ]; then
	TARBALL="chef-client-0.9.8-centos5.5-x86_64.tar.gz"
	if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
		TARBALL="chef-server-0.9.8-centos5.5-x86_64.tar.gz"
	fi
else
	if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
		TARBALL="chef-server-0.9.8-centos5.4-x86_64.tar.gz"
	fi
fi

rpm -q rsync &> /dev/null || yum install -y -q rsync
rpm -q wget &> /dev/null || yum install -y -q wget

if ! rpm -q rubygem-chef &> /dev/null; then

	local CHEF_RPM_DIR=$(mktemp -d)

	wget "$CDN_BASE/$TARBALL" -O "$CHEF_RPM_DIR/chef.tar.gz" &> /dev/null \
		|| { echo "Failed to download Chef RPM tarball."; exit 1; }
	cd $CHEF_RPM_DIR

	tar xzf chef.tar.gz || { echo "Failed to extract Chef tarball."; exit 1; }
	rm chef.tar.gz
	cd chef*
	yum install -q -y --nogpgcheck */*.rpm
	if [[ "$INSTALL_TYPE" == "SERVER" ]]; then
		rpm -q rubygem-chef-server &> /dev/null || { echo "Failed to install chef."; exit 1; }
	else
		rpm -q rubygem-chef &> /dev/null || { echo "Failed to install chef."; exit 1; }
	fi
	cd /tmp
	rm -Rf "$CHEF_RPM_DIR"

fi

}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
chef-vpc-toolkit-2.8.2 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.8.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.8.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.7.2 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.7.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.7.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.6.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.6.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.5.2 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.5.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.5.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.4.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.3.2 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.3.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.3.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.2.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.1.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.0.1 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash
chef-vpc-toolkit-2.0.0 lib/chef-vpc-toolkit/chef_bootstrap/centos.bash