aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/base.pp1
-rw-r--r--manifests/subsystem/apt.pp26
-rw-r--r--templates/apt/Debian.sources.list.erb20
-rw-r--r--templates/apt/sources.list.erb0
4 files changed, 47 insertions, 0 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 87433a4..859eccb 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -3,6 +3,7 @@ class nodo::base {
include lsb
# Then include our subsystems
+ include nodo::subsystem::apt
include nodo::subsystem::sudo
include nodo::subsystem::locales
include nodo::subsystem::screen
diff --git a/manifests/subsystem/apt.pp b/manifests/subsystem/apt.pp
new file mode 100644
index 0000000..83d49aa
--- /dev/null
+++ b/manifests/subsystem/apt.pp
@@ -0,0 +1,26 @@
+class nodo::subsystem::apt(
+ $ensure = present,
+ $auto_upgrade = present,
+) {
+ file { '/etc/apt/sources.list':
+ ensure => $ensure ? {
+ 'present' => 'present',
+ default => undef,
+ },
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => template("nodo/apt/${::operatingsystem}.sources.list.erb"),
+ }
+
+ $apt = '/usr/bin/apt-get'
+ $command = "${apt} update && ${apt} dist-upgrade -y && ${apt} autoremove -y && ${apt} clean"
+
+ cron { 'nodo-apt-auto-upgrade':
+ ensure => $auto_upgrade,
+ command => $command,
+ user => 'root',
+ hour => 2,
+ minute => 0,
+ }
+}
diff --git a/templates/apt/Debian.sources.list.erb b/templates/apt/Debian.sources.list.erb
new file mode 100644
index 0000000..b45a5e2
--- /dev/null
+++ b/templates/apt/Debian.sources.list.erb
@@ -0,0 +1,20 @@
+# This file is managed by puppet
+# all local modifications will be overwritten
+
+### Debian current: <%= scope.lookupvar('::lsbdistcodename') %>
+
+# basic
+deb http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %> main contrib non-free
+deb-src http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %> main contrib non-free
+
+# updates
+deb http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %>-updates main contrib non-free
+deb-src http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %>-updates main contrib non-free
+
+# security
+deb http://security.debian.org/ <%= scope.lookupvar('::lsbdistcodename') %>/updates main contrib non-free
+deb-src http://security.debian.org/ <%= scope.lookupvar('::lsbdistcodename') %>/updates main contrib non-free
+
+# backports
+deb http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %>-backports main contrib non-free
+deb-src http://http.debian.net/debian/ <%= scope.lookupvar('::lsbdistcodename') %>-backports main contrib non-free
diff --git a/templates/apt/sources.list.erb b/templates/apt/sources.list.erb
deleted file mode 100644
index e69de29..0000000
--- a/templates/apt/sources.list.erb
+++ /dev/null