aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-19 15:39:19 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-19 15:39:19 -0300
commitf4d75f5e67f1dc42709abfc4abdf8b9f05638162 (patch)
tree090dc511768f414571fd24d0d07659b6b1a366b2
parent2fcf5d39f99c9029153bfcd6be3191fd722f729f (diff)
downloadpuppet-nodo-f4d75f5e67f1dc42709abfc4abdf8b9f05638162.tar.gz
puppet-nodo-f4d75f5e67f1dc42709abfc4abdf8b9f05638162.tar.bz2
Adds nodo::subsystem::apt::repo
-rw-r--r--manifests/subsystem/apt/repo.pp28
1 files changed, 28 insertions, 0 deletions
diff --git a/manifests/subsystem/apt/repo.pp b/manifests/subsystem/apt/repo.pp
new file mode 100644
index 0000000..b83f043
--- /dev/null
+++ b/manifests/subsystem/apt/repo.pp
@@ -0,0 +1,28 @@
+class nodo::subsystem::apt::repo(
+ $definition,
+ $key_source,
+) {
+ file { "/etc/apt/trusted.gpg.d/${name}.gpg":
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ source => $source,
+ }
+
+ file { "/etc/apt/sources.list.d/${name}.list":
+ ensure => present,
+ owner => "root",
+ group => "root",
+ mode => "0644",
+ content => "${definition}\n"
+ require => File["/etc/apt/trusted.gpg.d/${name}.gpg"],
+ notify => Exec["apt-repo-auto-update-${name}"],
+ }
+
+ exec { "apt-repo-auto-update-${name}":
+ command => "/usr/bin/apt-get update",
+ user => "root",
+ refreshonly => true,
+ }
+}