aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/subsystem')
-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,
+ }
+}