d-i should use apt.conf.d instead of adding proxy to apt.conf directly

Bug #1060900 reported by Ryan Finnie
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-setup (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

When deploying a node, /etc/apt/apt.conf is being created with, for example:

Acquire::http::Proxy "http://10.55.65.6:8000/";

Please instead deploy this in, say, /etc/apt/apt.conf.d/90maas.

Version: precise 0.1+bzr482+dfsg-0ubuntu1

Ryan Finnie (fo0bar)
description: updated
Revision history for this message
Robie Basak (racb) wrote :

I think this is being done automatically by d-i as a result of the proxy being preseeded. In other words, if you automatically install an Ubuntu system without MAAS and preseed a proxy, you'll get the same result.

What is the reason that MAAS should do something different from d-i here? Or is this a request to change d-i's behaviour?

Revision history for this message
Robie Basak (racb) wrote :

Marking Incomplete pending response.

Changed in maas (Ubuntu):
status: New → Incomplete
Revision history for this message
Ryan Finnie (fo0bar) wrote :

Ahh, if it is d-i doing it directly, so be it. The reason it should be separated out into a .d entry is basically, splitting out into .d entries are generally more manageable than using a main config file, especially if you want to undo this functionality change. (Remove the .d file rather than grepping through apt.conf trying to remove that line without blowing away other potential functionality in there.)

In our specific case, we don't want the running node to be using MAAS's local squid-deb-proxy setup, due to needing to add non-standard apt sources as part of a deployed Juju charm, and having a "local" archive mirror anyway. Ideally it would be best to have an option to not use a proxy server in MAAS (and there are bugs open asking for this), but failing that, I've added code to our charm to disable the apt proxy as one of the first steps of the charm, before the other apt sources are added. That is how I found the conf option is being put directly in /etc/apt/apt.conf, rather than an apt.conf.d file.

Changed in maas (Ubuntu):
status: Incomplete → New
Revision history for this message
Robie Basak (racb) wrote :

Thanks for the explanation Ryan!

I feel that there must be a better way, such as the apt proxy working with non-standard apt sources without issues. But wanting to disable any existing apt proxy in a charm does make sense.

What if debian-installer were changed to always use /etc/apt/apt.conf.d/10proxy? Although there would still be no guarantee if that file doesn't exist that there is no proxy configured some other way, and the same charm might conceivably run on some other service provider's cloud instance with a proxy set in some other way.

Changing this task to debian-installer for consideration nevertheless.

But we should have a separate upstream MAAS bug to add a configurable proxy. You mentioned existing bugs, but I can't find one. Do you have a bug number, or shall we create a separate bug if not?

affects: maas (Ubuntu) → debian-installer (Ubuntu)
summary: - HTTP proxy config being created in /etc/apt/apt.conf on nodes
+ d-i should use apt.conf.d instead of adding proxy to apt.conf directly
Changed in debian-installer (Ubuntu):
status: New → Incomplete
Colin Watson (cjwatson)
affects: debian-installer (Ubuntu) → apt-setup (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for apt-setup (Ubuntu) because there has been no activity for 60 days.]

Changed in apt-setup (Ubuntu):
status: Incomplete → Expired
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.