Skip to content

Instantly share code, notes, and snippets.

@philcryer
Last active December 26, 2015 03:59
Show Gist options
  • Save philcryer/7089685 to your computer and use it in GitHub Desktop.
Save philcryer/7089685 to your computer and use it in GitHub Desktop.
Need to put proxy into .curlrc during bootstrap so curl can get install.sh from chef and get started - but when it writes it into the .curlrc file, it contains 'unsupported trailing garbage' so it doesn't work
** I have the bootstrap_proxy set in knife.rb
$ cat .chef/knife.rb | tail -n1
knife[:bootstrap_proxy] = "http://111.111.111.9:8080"
** in bootstrap/chef-full.erb I tell it to write it to ~/.curlrc
(
cat <<'EOP'
<%= "http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" %>
EOP
) > ~/.curlrc
** but bootstrap fails, curl has 'unsupported trailing garbage'
$ knife bootstrap 111.111.111.157 --ssh-user root --ssh-password 'this-is-a-password-orly' --template-file bootstrap/chef-full.erb --run-list=recipe[base]
Bootstrapping Chef on 111.111.111.157
10.111.111.157 Warning: /root/.curlrc:1: warning: 'http_proxy' had unsupported trailing garbage
10.111.111.157 Warning: garbage
10.111.111.157 curl: option --proxy=on: is unknown
10.111.111.157 curl: try 'curl --help' or 'curl --manual' for more information
10.111.111.157 bash: line 89: chef-client: command not found
** but the script worked, it did write the file and it looks right
# cat .curlrc
http_proxy="http://111.111.111.9:8080"
** what's wrong?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment