Salt Cloud - Add Proxy to VM

24 views
Skip to first unread message

Batgranny

unread,
Apr 26, 2019, 9:20:10 AM4/26/19
to Salt-users
I've been attempting to privision a Ubuntu VM using salt cloud in and environment that accesses the Internet via a proxy.  I see that when provisioning the server the minion installation hangs because the machine can't access the internet:

 *  INFO: Installing minion
 *  INFO: Found function install_ubuntu_stable_deps
 *  INFO: Found function config_salt
 *  INFO: Found function install_ubuntu_stable
 *  INFO: Found function install_ubuntu_restart_daemons
 *  INFO: Found function daemons_running
 *  INFO: Found function install_ubuntu_check_services
 *  INFO: Running install_ubuntu_stable_deps()
  Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::19). - connect (101: Network is unreachable) [IP: 2001:67c:1562::19 80]

I'm wondering is there a method to pass a proxy to the VM via salt so that the provisioning can complete?  I have tried using preflight_cmds to echo the proxy address to /etc/apt/apt.conf but I see a permission denied error.  Alternatively, if there is a method to allow me to gain root permissions so that I can add the proxy information via preflight_cmds or a file push that would be great.


Batgranny

unread,
Apr 26, 2019, 10:10:56 AM4/26/19
to Salt-users
I was able to resolve this by adding the proxy URL in the _HTTP_PROXY variable in bootstrap-salt.sh:

old: _HTTP_PROXY=""
new: _HTTP_PROXY"myproxyurl"

Diego Barrantes

unread,
Apr 26, 2019, 10:21:26 AM4/26/19
to Salt-users
Thanks for posting the solution even thou no one answered.

I guess you are missing a = after the _HTTP_PROXY ?

Batgranny

unread,
Apr 26, 2019, 10:51:33 AM4/26/19
to Salt-users
Yes, sorry, that should be:

old: _HTTP_PROXY=""
new: _HTTP_PROXY="myproxyurl"
Reply all
Reply to author
Forward
0 new messages