summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Holer <vlastimil.holer@gmail.com>2013-02-21 16:29:06 +0100
committerVlastimil Holer <vlastimil.holer@gmail.com>2013-02-21 16:29:06 +0100
commit10ea1c0bb933b21d32012d89b218a3bbbd15a75a (patch)
tree1d71479c6caf3ce4fbd275f9e8a93c69f7cb7dde
parent3f61f2ee54ca1e550c733bb5d9b27f6250c1e51e (diff)
downloadvyos-cloud-init-10ea1c0bb933b21d32012d89b218a3bbbd15a75a.tar.gz
vyos-cloud-init-10ea1c0bb933b21d32012d89b218a3bbbd15a75a.zip
Split Debian and Ubuntu APT sources
-rw-r--r--cloudinit/config/cc_apt_configure.py9
-rw-r--r--templates/sources.list.debian.tmpl28
-rw-r--r--templates/sources.list.ubuntu.tmpl (renamed from templates/sources.list.tmpl)0
3 files changed, 34 insertions, 3 deletions
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index f8664160..3ce3b351 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -140,10 +140,13 @@ def get_release():
def generate_sources_list(codename, mirrors, cloud, log):
- template_fn = cloud.get_template_filename('sources.list')
+ template_fn = cloud.get_template_filename('sources.list.%s' %
+ (cloud.distro.name))
if not template_fn:
- log.warn("No template found, not rendering /etc/apt/sources.list")
- return
+ template_fn = cloud.get_template_filename('sources.list')
+ if not template_fn:
+ log.warn("No template found, not rendering /etc/apt/sources.list")
+ return
params = {'codename': codename}
for k in mirrors:
diff --git a/templates/sources.list.debian.tmpl b/templates/sources.list.debian.tmpl
new file mode 100644
index 00000000..609bc6bd
--- /dev/null
+++ b/templates/sources.list.debian.tmpl
@@ -0,0 +1,28 @@
+\## Note, this file is written by cloud-init on first boot of an instance
+\## modifications made here will not survive a re-bundle.
+\## if you wish to make changes you can:
+\## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
+\## or do the same in user-data
+\## b.) add sources in /etc/apt/sources.list.d
+\## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
+\###
+
+# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
+# for how to upgrade to newer versions of the distribution.
+deb $mirror $codename main contrib non-free
+deb-src $mirror $codename main contrib non-free
+
+\## Major bug fix updates produced after the final release of the
+\## distribution.
+deb $security $codename/updates main contrib non-free
+deb-src $security $codename/updates main contrib non-free
+deb $mirror $codename-updates main contrib non-free
+deb-src $mirror $codename-updates main contrib non-free
+
+\## Uncomment the following two lines to add software from the 'backports'
+\## repository.
+\## N.B. software from this repository may not have been tested as
+\## extensively as that contained in the main release, although it includes
+\## newer versions of some applications which may provide useful features.
+# deb http://backports.debian.org/debian-backports $codename-backports main contrib non-free
+# deb-src http://backports.debian.org/debian-backports $codename-backports main contrib non-free
diff --git a/templates/sources.list.tmpl b/templates/sources.list.ubuntu.tmpl
index ce395b3d..ce395b3d 100644
--- a/templates/sources.list.tmpl
+++ b/templates/sources.list.ubuntu.tmpl