Skip to content

Instantly share code, notes, and snippets.

@kuleszaj
Created November 28, 2012 21:42
Show Gist options
  • Save kuleszaj/4164803 to your computer and use it in GitHub Desktop.
Save kuleszaj/4164803 to your computer and use it in GitHub Desktop.
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