summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2017-08-26 18:42:21 +0200
committerJan Dittberner <jandd@cacert.org>2017-08-26 18:42:21 +0200
commite8226e73b5e4e13e1e760aa78fe01062041c11ee (patch)
tree4f946456b60d9ef538e6f519dbaabfbae07be864
parentbc85d45ec3501c4ce566512ec11f8197bd942a15 (diff)
downloadcacert-puppet-e8226e73b5e4e13e1e760aa78fe01062041c11ee.tar.gz
cacert-puppet-e8226e73b5e4e13e1e760aa78fe01062041c11ee.tar.xz
cacert-puppet-e8226e73b5e4e13e1e760aa78fe01062041c11ee.zip
Manage APT sources
-rw-r--r--sitemodules/profiles/manifests/base.pp25
-rw-r--r--sitemodules/profiles/templates/base/apt_sources.list.epp6
-rw-r--r--sitemodules/profiles/templates/base/apt_sources_puppetlabs.list.epp4
3 files changed, 35 insertions, 0 deletions
diff --git a/sitemodules/profiles/manifests/base.pp b/sitemodules/profiles/manifests/base.pp
index 86daddb..d67fff6 100644
--- a/sitemodules/profiles/manifests/base.pp
+++ b/sitemodules/profiles/manifests/base.pp
@@ -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
index 0000000..ecc8cde
--- /dev/null
+++ b/sitemodules/profiles/templates/base/apt_sources.list.epp
@@ -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
index 0000000..40868ed
--- /dev/null
+++ b/sitemodules/profiles/templates/base/apt_sources_puppetlabs.list.epp
@@ -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