X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fconf.pp;h=0aec66dd63f69f5bb68195e4f9f6120c0c6332ae;hb=refs%2Fheads%2Fpdksync_%28MAINT%29_Pin_puppetlabs-puppet_agent;hp=49e32abaaa256254fd0d144d0bfc0eeed9187cef;hpb=351c8d5941f6bd02304df6b4185dea8c8104aefa;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/conf.pp b/manifests/conf.pp index 49e32ab..0aec66d 100644 --- a/manifests/conf.pp +++ b/manifests/conf.pp @@ -1,13 +1,35 @@ +# @summary Specifies a custom Apt configuration file. +# +# @param content +# Required unless `ensure` is set to 'absent'. Directly supplies content for the configuration file. +# +# @param ensure +# Specifies whether the configuration file should exist. Valid options: 'present' and 'absent'. +# +# @param priority +# Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first. +# Valid options: a string containing an integer or an integer. +# +# @param notify_update +# Specifies whether to trigger an `apt-get update` run. +# 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, } }