define apt::conf (
- $content,
- $ensure = present,
- $priority = '50',
+ Optional[Variant[String, Stdlib::Compat::String]] $content = undef,
+ Enum['present', 'absent'] $ensure = present,
+ Variant[String, Stdlib::Compat::String, Integer, Stdlib::Compat::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,
- base_name => $name,
- setting_type => 'conf',
- priority => $priority,
- content => template('apt/_header.erb', 'apt/conf.erb'),
+ ensure => $ensure,
+ priority => $priority,
+ content => "${confheadertmp}${content}",
+ notify_update => $notify_update,
}
}