X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fconf.pp;h=eea06861d9e3793e807a9e77d5388d0897941d3c;hb=811bbd90db7b205c3f32f35ee3919e4564192af0;hp=49e32abaaa256254fd0d144d0bfc0eeed9187cef;hpb=e588ab622b042855b214c2e25bc6fe4a2b4fb650;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/conf.pp b/manifests/conf.pp index 49e32ab..eea0686 100644 --- a/manifests/conf.pp +++ b/manifests/conf.pp @@ -1,13 +1,21 @@ 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, } }