X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fconf.pp;h=b791f852190b4f5938774f1a4ae90db348a6ee39;hb=4d21aebedd1160fbfbdce2b33f62109d87dd2aea;hp=49e32abaaa256254fd0d144d0bfc0eeed9187cef;hpb=a634fe2189fd044d69ec9a2e9ff7f4cc76403113;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/conf.pp b/manifests/conf.pp index 49e32ab..b791f85 100644 --- a/manifests/conf.pp +++ b/manifests/conf.pp @@ -1,13 +1,22 @@ +# Defining apt config define apt::conf ( - $content, - $ensure = present, - $priority = '50', + 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, - 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, } }