(CONT-844) - Update .sync.yml
[puppet-modules/puppetlabs-apt.git] / manifests / conf.pp
index 8cd9c64e7841064ffa5c92e451daba8a48dd3090..0aec66dd63f69f5bb68195e4f9f6120c0c6332ae 100644 (file)
@@ -1,20 +1,35 @@
+# @summary Specifies a custom Apt configuration file.
+#
+# @param content
+#   Required unless `ensure` is set to 'absent'. Directly supplies content for the configuration file.
+#
+# @param ensure
+#    Specifies whether the configuration file should exist. Valid options: 'present' and 'absent'. 
+#
+# @param priority
+#   Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first. 
+#   Valid options: a string containing an integer or an integer.
+#
+# @param notify_update
+#   Specifies whether to trigger an `apt-get update` run.
+#
 define apt::conf (
-  $content       = undef,
-  $ensure        = present,
-  $priority      = 50,
-  $notify_update = undef,
+  Optional[String] $content          = undef,
+  Enum['present', 'absent'] $ensure  = present,
+  Variant[String, Integer] $priority = 50,
+  Optional[Boolean] $notify_update   = undef,
 ) {
-
   unless $ensure == 'absent' {
     unless $content {
       fail('Need to pass in content parameter')
     }
   }
 
+  $confheadertmp = epp('apt/_conf_header.epp')
   apt::setting { "conf-${name}":
     ensure        => $ensure,
     priority      => $priority,
-    content       => template('apt/_conf_header.erb', 'apt/conf.erb'),
+    content       => "${confheadertmp}${content}",
     notify_update => $notify_update,
   }
 }