Manage APT sources
authorJan Dittberner <jandd@cacert.org>
Sat, 26 Aug 2017 16:42:21 +0000 (18:42 +0200)
committerJan Dittberner <jandd@cacert.org>
Sat, 26 Aug 2017 16:42:21 +0000 (18:42 +0200)
sitemodules/profiles/manifests/base.pp
sitemodules/profiles/templates/base/apt_sources.list.epp [new file with mode: 0644]
sitemodules/profiles/templates/base/apt_sources_puppetlabs.list.epp [new file with mode: 0644]

index 86daddb..d67fff6 100644 (file)
@@ -80,4 +80,29 @@ class profiles::base (
     mode   => '0644',
     source => 'puppet:///modules/profiles/base/apt_proxy.conf',
   }
+
+  package { 'lsb-release':
+    ensure => present,
+  }
+
+  file { '/etc/apt/sources.list':
+    ensure  => file,
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    content => epp(
+      'profiles/base/apt_sources.list.epp',
+      {'oscodename' => $facts['os']['distro']['codename']}),
+    require => Package['lsb-release'],
+  }
+  file { '/etc/apt/sources.list.d/puppetlabs-pc1.list':
+    ensure  => file,
+    owner   => 'root',
+    group   => 'root',
+    mode    => '0644',
+    content => epp(
+      'profiles/base/apt_sources_puppetlabs.list.epp',
+      {'oscodename' => $facts['os']['distro']['codename']}),
+    require => Package['lsb-release'],
+  }
 }
diff --git a/sitemodules/profiles/templates/base/apt_sources.list.epp b/sitemodules/profiles/templates/base/apt_sources.list.epp
new file mode 100644 (file)
index 0000000..ecc8cde
--- /dev/null
@@ -0,0 +1,6 @@
+<%- | String $oscodename = "" |-%>
+# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE
+# NEXT PUPPET RUN.
+deb http://ftp.nl.debian.org/debian <%= $oscodename %> main
+deb http://ftp.nl.debian.org/debian <%= $oscodename %>-backports main
+deb http://security.debian.org/debian-security <%= $oscodename %>/updates main
diff --git a/sitemodules/profiles/templates/base/apt_sources_puppetlabs.list.epp b/sitemodules/profiles/templates/base/apt_sources_puppetlabs.list.epp
new file mode 100644 (file)
index 0000000..40868ed
--- /dev/null
@@ -0,0 +1,4 @@
+<%- | String $oscodename = "" |-%>
+# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE
+# NEXT PUPPET RUN.
+deb http://apt.puppetlabs.com <%= $oscodename %> PC1