X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fconf.pp;h=b791f852190b4f5938774f1a4ae90db348a6ee39;hb=280b3a9ee4f9233026b0806bf12da378f0d95ce5;hp=fa7f97d435f6001c3bea06cf2f50e921f2a3f4fa;hpb=17b9ac3c7f0aaf7322eae634fb0f35eb27bf872c;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/conf.pp b/manifests/conf.pp index fa7f97d..b791f85 100644 --- a/manifests/conf.pp +++ b/manifests/conf.pp @@ -1,17 +1,22 @@ +# Defining apt config 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, } }