X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=manifests%2Fpin.pp;h=bcccf28b7c8058532e30827c172a58f0f171bc1b;hb=23855f199bed69cdd50aff411942c7704a40c824;hp=214fa997e8d9a2c112b883c8abf6605dd58eab07;hpb=e588ab622b042855b214c2e25bc6fe4a2b4fb650;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/manifests/pin.pp b/manifests/pin.pp index 214fa99..bcccf28 100644 --- a/manifests/pin.pp +++ b/manifests/pin.pp @@ -3,7 +3,7 @@ define apt::pin( $ensure = present, - $explanation = "${caller_module_name}: ${name}", + $explanation = undef, $order = undef, $packages = '*', $priority = 0, @@ -20,6 +20,16 @@ define apt::pin( fail('Only integers are allowed in the apt::pin order param') } + if $explanation { + $_explanation = $explanation + } else { + if defined('$caller_module_name') { # strict vars check + $_explanation = "${caller_module_name}: ${name}" + } else { + $_explanation = ": ${name}" + } + } + $pin_release_array = [ $release, $codename, @@ -62,10 +72,8 @@ define apt::pin( $file_name = regsubst($title, '[^0-9a-z\-_\.]', '_', 'IG') apt::setting { "pref-${file_name}": - ensure => $ensure, - base_name => $file_name, - setting_type => 'pref', - priority => $order, - content => template('apt/_header.erb', 'apt/pin.pref.erb'), + ensure => $ensure, + priority => $order, + content => template('apt/_header.erb', 'apt/pin.pref.erb'), } }