Add ability to set proxy for environment

Bug #1702332 reported by Julen Larrucea
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Wishlist
Unassigned

Bug Description

On Ubuntu 17.04
MaaS 2.2.0~rc1+bzr5922-0ubuntu2

 Setting up a custom http-proxy is used for '/etc/apt.conf.d/90cloud-init-aptproxy' on the targets while commissioning. So far so good.

 Unfortunately, the commissioning of a plain and default Ubuntu node also involves some fancy calls to
i.e. 'https://search.apps.ubuntu.com/api/v1/snaps/metadata' or 'ntp.ubuntu.com'.
 These calls will not likely success, because, as the $http_proxy variable on the controller already knows, ... we are behind a proxy.

 Why not to include the http_proxy as a global environment variable on the target nodes?

Tags: http-proxy
Julen Larrucea (julenl)
description: updated
Revision history for this message
Julen Larrucea (julenl) wrote :

Ideally this should be handled directly by MaaS, or disable the unrelated services (such as snapd).

I worked around the problem with a custom script.

cat > 0-maas-http_proxy << EOF
#! /bin/bash

echo 'http_proxy=http://myproxy.example.com:8080' >> /etc/environment
echo 'https_proxy=http://myproxy.example.com:8080' >> /etc/environment
EOF

... and upload it as graphic interface under Settings > "Commissioning scripts".

If you also need to deal with the calls to ntp.ubuntu.com (bug #1702329), append something like this to the script above.

sed -i 's/^#NTP=/NTP=ntp.example.com/' /etc/systemd/timesyncd.conf
service systemd-timesyncd restart

Revision history for this message
Andres Rodriguez (andreserl) wrote :

The proxy is configured by cloud-init. I'd think that cloud-init would need to gain support for configuring the system proxy as well, and in MAAS, there should be an option that allows to select the user whether to enable this only for APT, or system wide.

In the meantime, this is marked as wishlist.

Changed in maas:
importance: Undecided → Wishlist
milestone: none → 2.3.0
status: New → Triaged
summary: - http_proxy only for apt?
+ Add ability to set proxy for environment
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Also, FWIW, since MAAS does only OS deployments (and not application deployments) MAAS only sets the APT proxy, as it is the only thing needed to deploy the machine.

Setting the system's proxy, is something for the administrator to do. This is because it will impact how the system and the applications behave.

For example, when you use MAAS with Juju, it is up to juju to set the proxies for the different applications you are going to deploy [1]. This is when juju will actually set the system's proxy to ensure that applications do what they need with the correct proxy. Doing so allows flexibility for Juju to set 1 proxy for applications, while the machine can still use a /different/ proxy for APT. Hence MAAS only sets APT proxy.

That said, I still think having the ability for MAAS to set the system proxy, is a nice-to-have. But for us to do it nicely, we would need a feature in cloud-init [2], since we use cloud-init to set the proxy settings.

I'll keep this as a wishlist.

[1]: https://jujucharms.com/docs/2.2/models-config
[2]: https://bugs.launchpad.net/cloud-init/+bug/1089405

Changed in maas:
milestone: 2.3.0 → 2.3.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.