diff options
author | Gabriel Filion <gabster@lelutin.ca> | 2017-02-24 15:50:32 -0500 |
---|---|---|
committer | Gabriel Filion <gabster@lelutin.ca> | 2017-02-24 15:51:43 -0500 |
commit | 38a2b7900178fa00c8dfd16481c84818d2b9a47a (patch) | |
tree | e1c29b4b518ce98b02281ed1be24a9bce914f499 /manifests | |
parent | dfbfc7a05f7ac6713b4ac1379cfb6e2cefa85093 (diff) |
teach apt::package to mange pins for packages
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/package.pp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/manifests/package.pp b/manifests/package.pp index b2ae79d..159d693 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -2,6 +2,8 @@ define apt::package ( $ensure = 'present', $seedfile_content = '', + $pin = '', + $pin_priority = 1000 ) { $seedfile = "/var/cache/local/preseeding/${name}.seeds" @@ -17,9 +19,17 @@ define apt::package ( group => 0, } + if $pin { + apt::preferences_snippet { $name: + ensure => $ensure, + priority => $pin_priority, + pin => $pin, + } + } + package { $name: ensure => $ensure, responsefile => $seedfile, - require => File[$seedfile], + require => [File[$seedfile], Apt::Preferences_snippet[$name]], } } |