Fixed circular dependency for package dirmngr
[puppet-modules/puppetlabs-apt.git] / manifests / conf.pp
index c1af710fd4b2a3b45f92f830a7eafeab27464935..eea06861d9e3793e807a9e77d5388d0897941d3c 100644 (file)
@@ -1,17 +1,21 @@
 define apt::conf (
-  $priority = '50',
-  $content
-  ) {
+  Optional[String] $content          = undef,
+  Enum['present', 'absent'] $ensure  = present,
+  Variant[String, Integer] $priority = 50,
+  Optional[Boolean] $notify_update   = undef,
+) {
 
-  include apt::params
-
-  $apt_conf_d = $apt::params::apt_conf_d
+  unless $ensure == 'absent' {
+    unless $content {
+      fail('Need to pass in content parameter')
+    }
+  }
 
-  file { "${apt_conf_d}/${priority}${name}":
-    ensure  => file,
-    content => $content,
-    owner   => root,
-    group   => root,
-    mode    => '0644',
+  $confheadertmp = epp('apt/_conf_header.epp')
+  apt::setting { "conf-${name}":
+    ensure        => $ensure,
+    priority      => $priority,
+    content       => "${confheadertmp}${content}",
+    notify_update => $notify_update,
   }
 }