3

Although juju model-config supports proxies, before a model exists, I'm having a very hard time setting an HTTP proxy.

Just running juju bootstrap localhost lxd-test fails because juju doesn't use the proxy.

How can I tell Juju to use a proxy?

0

3 Answers 3

8

From the MAAS freenode community, I learned that I could run:

--config=config.yaml

Where config.yaml contains:

default-series: xenial
no-proxy: localhost
apt-http-proxy: http://<ip address>:<port>
apt-https-proxy: https://<ip address>:<port>
apt-ftp-proxy: ftp://<ip address>:<port>
http-proxy: http://<ip address>:<port>
https-proxy: https://<ip address>:<port>
ftp-proxy: ftp://<ip address>:<port>

This isn't documented anywhere in the MAAS or Juju documentation, disappointingly. This didn't actually solve my issue either, though I believe it addressed the direct question of setting a proxy before a model exists. I believe the issue I'm having is due to unrelated DNS confusion within my network.

5
  • I found this comment by ptylenda here which might be useful although it looks like the issue was closed and the PPA was updated.
    – Elder Geek
    Commented Nov 23, 2016 at 21:49
  • Thanks! I'm not sure exactly what changes were made, but it doesn't appear that anything like the old environments.yaml has come back. Commented Nov 23, 2016 at 22:03
  • @NateGardner It is documented right here. I'm curious whether you used the doc site. If you did, did a search for 'proxy' not work out?
    – pmatulis
    Commented Nov 24, 2016 at 14:55
  • I didn't see the line "These values can also be passed to a new controller for use with the default model it creates. To do this, use the --config argument with bootstrap." It appeared this could only be set after a model was created based on the intro to the section. Commented Dec 7, 2016 at 19:24
  • Additionally I had to add "snap-http-proxy: http://<ip address>:<port>" and "snap-https-proxy: https://<ip address>:<port>"
    – tangens
    Commented Sep 8, 2021 at 18:04
2

Use

--config http-proxy=http://<ip address>:<port> --config https-proxy=http://<ip address>:<port>

2

During the bootstrap process, you probably want to specify the proxies as model defaults. These will apply both to the controller model, and to any subsequent models that are created in that controller.

juju bootstrap lxd --model-defaults=config.yaml

Configuration attributes specified with --config will only apply to the controller model, and not other models.

1
  • 1
    Error: flag provided but not defined: --model-defaults. This isn't valid syntax in the current version of Juju Commented Dec 8, 2016 at 4:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .