X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fconf.pp;h=b791f852190b4f5938774f1a4ae90db348a6ee39;hb=4d21aebedd1160fbfbdce2b33f62109d87dd2aea;hp=c1af710fd4b2a3b45f92f830a7eafeab27464935;hpb=4a788a60f913d5d7934aef9fa0eda68152a3e8b3;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/conf.pp b/manifests/conf.pp index c1af710..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, } }