Created
November 28, 2012 21:42
-
-
Save kuleszaj/4164803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
exists() { | |
if command -v $1 &>/dev/null | |
then | |
return 0 | |
else | |
return 1 | |
fi | |
} | |
install_sh="http://opscode.com/chef/install.sh" | |
version_string="<%= "-v #{knife_config[:bootstrap_version]}" if knife_config[:bootstrap_version] %>" | |
if ! exists /usr/bin/chef-client; then | |
if exists wget; then | |
bash <(wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %> ${install_sh} -O -) ${version_string} | |
else | |
if exists curl; then | |
bash <(curl -L <%= "--proxy=on " if knife_config[:bootstrap_proxy] %> ${install_sh}) ${version_string} | |
fi | |
fi | |
fi | |
mkdir -p /etc/chef | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment