diff options
-rw-r--r-- | cloudinit/config/cc_apt_update_upgrade.py | 2 | ||||
-rw-r--r-- | doc/examples/cloud-config.txt | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/cloudinit/config/cc_apt_update_upgrade.py b/cloudinit/config/cc_apt_update_upgrade.py index 5c5e510c..76ecfb42 100644 --- a/cloudinit/config/cc_apt_update_upgrade.py +++ b/cloudinit/config/cc_apt_update_upgrade.py @@ -255,7 +255,7 @@ def find_apt_mirror(cloud, cfg): if mydom: doms.append(".%s" % mydom) - if not mirror: + if not mirror and cfg.get(cfg, "apt_mirror_search_dns", False): doms.extend((".localdomain", "",)) mirror_list = [] diff --git a/doc/examples/cloud-config.txt b/doc/examples/cloud-config.txt index 82055d09..1e6628d2 100644 --- a/doc/examples/cloud-config.txt +++ b/doc/examples/cloud-config.txt @@ -28,11 +28,14 @@ apt_upgrade: true # then use the mirror provided by the DataSource found. # In EC2, that means using <region>.ec2.archive.ubuntu.com # -# if no mirror is provided by the DataSource, then search -# for dns names '<distro>-mirror' in each of +# if no mirror is provided by the DataSource, and 'apt_mirror_search_dns' is +# true, then search for dns names '<distro>-mirror' in each of # - fqdn of this host per cloud metadata # - localdomain # - no domain (which would search domains listed in /etc/resolv.conf) +# If there is a dns entry for <distro>-mirror, then it is assumed that there +# is a distro mirror at http://<distro>-mirror.<domain>/<distro> +# # That gives the cloud provider the opportunity to set mirrors of a distro # up and expose them only by creating dns entries. # @@ -42,6 +45,8 @@ apt_mirror_search: - http://local-mirror.mydomain - http://archive.ubuntu.com +apt_mirror_search_dns: False + # apt_proxy (configure Acquire::HTTP::Proxy) apt_proxy: http://my.apt.proxy:3128 |