Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud-init should support apt-proxy and hostname based mirror selection #2228

Closed
ubuntu-server-builder opened this issue May 9, 2023 · 3 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #897688

Launchpad details
affected_projects = []
assignee = smoser
assignee_name = Scott Moser
date_closed = 2012-04-11T04:09:50.500172+00:00
date_created = 2011-11-29T13:55:04.384203+00:00
date_fix_committed = 2011-12-16T21:44:40.918458+00:00
date_fix_released = 2012-04-11T04:09:50.500172+00:00
id = 897688
importance = medium
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/897688
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = smoser
submitter_name = Scott Moser
tags = []
duplicates = []

Launchpad user Scott Moser(smoser) wrote on 2011-11-29T13:55:04.384203+00:00

currently, in EC2, there is logic to select a mirror based on existence of a dns name that matches the region. Ie
 * cloud-init checks ec2 metadata for availability zone (like us-east-1a)
 * take off the 'a',
 * check for dns name of us-east-1.ec2.archive.ubuntu.com
 * use that as mirror if available or fall back to default.

This is good enough for EC2, but not so good for private clouds.
A private cloud may have either a proxy or a full mirror, and want to use that without requiring custom user data on every launch or modifications to the stock images.

To support this, I propose:
 * if user-data specifies 'apt_mirror' or 'apt_proxy' use that.
 * if a dnsname exists for $availability-zone.archive in the default domain, use that.
 * if a dnsname exists in default domain for 'apt-proxy' then configure apt to use that as the proxy
 * if a dnsname exists in default domain for 'ubuntu-mirror' then configure apt to use that mirror

This allows the owner of a private cloud to set up dns entries so that cloud guest images "just work", but also allow for user configuration via cloud-config data like:
 apt_proxy: http://192.168.1.1:3128/

Related bugs:

  • bug 974509: cloud-init selects wrong mirror with dns server redirection
@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 9, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2011-12-16T21:44:40.534437+00:00

pushed up revision 486 for this.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Andreas Hasenack(ahasenack) wrote on 2012-07-05T17:00:14.007899+00:00

This breaks those customers with (already broken) ISPs that have wildcard domains, because "ubuntu-mirror.localdomain" resolves to an actual internet IP, but it's just to show the user a nice html page saying that the domain was not found. Maybe with ads.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Scott Moser(smoser) wrote on 2012-07-06T13:45:57.314030+00:00

The bug for Andreas's referenced issue is bug 974509.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant