juju2: where to specify http proxy

Andreas Hasenack andreas at canonical.com
Fri Apr 29 12:45:57 UTC 2016


Hi,

I'm trying to find out where do I specify a http proxy for clouds,
specifically MAAS.

https://jujucharms.com/docs/devel/clouds-maas has no mention of a proxy
variable. A search for "http-proxy" returns outdated references to the
environments.yaml file or juju set-env, even though I have selected "devel"
docs.

Going by trial and error, I added the setting to my clouds file yaml, like
this:
clouds:
    vmwarestack:
        type: maas
        auth-types: [oauth1]
        endpoint: 'http://10.245.200.27/MAAS/'
        http-proxy: http://10.245.200.27:8000/
        https-proxy: http://10.245.200.27:8000/
        no-proxy: localhost,127.0.0.1,10.245.200.27,10.245.202.1


Then I added it with juju add-cloud. No errors were shown. and list-clouds
confirms the cloud is there. But show-cloud doesn't list the proxy settings
:/
$ juju show-cloud local:vmwarestack
defined: local
type: maas
auth-types: [oauth1]
endpoint: http://10.245.200.27/MAAS/


Upon bootstrapping, it hangs at the curl stage:
$ juju bootstrap vmwarestack-controller vmwarestack --config
bootstrap-timeout=1800
Creating Juju controller "local.vmwarestack-controller" on vmwarestack
Bootstrapping model "admin"
(...)
Warning: Permanently added '10.245.202.67' (ECDSA) to the list of known
hosts.
Logging to /var/log/cloud-init-output.log on remote host
Running apt-get update
Running apt-get upgrade
Installing package: curl
Installing package: cpu-checker
Installing package: bridge-utils
Installing package: cloud-utils
Installing package: cloud-image-utils
Installing package: tmux
Fetching tools: curl -sSfw 'tools from %{url_effective} downloaded: HTTP
%{http_code}; time %{time_total}s; size %{size_download} bytes; speed
%{speed_download} bytes/s ' --retry 10 -o $bin/tools.tar.gz <[
https://streams.canonical.com/juju/tools/agent/2.0-beta6/juju-2.0-beta6-xenial-amd64.tgz
]>


Logging in on the node shows that curl it stuck:

 1369 ?        Ss     0:00 /usr/sbin/sshd -D
 2737 ?        Ss     0:00  \_ sshd: ubuntu [priv]
 2776 ?        S      0:00  |   \_ sshd: ubuntu at notty
 2777 ?        Ss     0:00  |       \_ sudo /bin/bash -c /bin/bash -c  set
-e tmpfile=$(mktemp) trap "rm -f $tmpfile" EXIT cat > $tmpfile /bin/bash
$tmpfile
 2781 ?        S      0:00  |           \_ /bin/bash
 2782 ?        S      0:00  |               \_ /bin/bash
 3716 ?        S      0:00  |                   \_ curl -sSfw tools from
%{url_effective} downloaded: HTTP %{http_code}; time %{time_total}s; size
%{size_download} bytes

And netstat confirms that it is not using the proxy:
tcp        0      1 10.245.202.67:49654     91.189.88.141:443
SYN_SENT    3716/curl

/etc/apt/apt.conf.d/95cloud-init-proxy has the proxy defined, but that I
think comes from the maas server, which has this same proxy setting:
cat /etc/apt/apt.conf.d/95cloud-init-proxy
Acquire::HTTP::Proxy "http://10.245.200.27:8000/";

Explains why apt worked, at least. But curl needs a system-wide proxy
setting.

/home/ubuntu has no file, hidden or otherwise, specifying the proxy, like
there used to be with juju1.

Help? :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20160429/bd36c8f4/attachment.html>


More information about the Juju mailing list