From 4334f9f2b9adb2e7881192494bcbd882dc1e2456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20V=C3=A9ronneau?= Date: Tue, 6 Mar 2018 21:13:17 +0000 Subject: Clarify how to use apt::pin and add `create_ressources` example --- UPGRADING.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 7085f06..7054637 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -60,6 +60,15 @@ By default, the puppetlabs module won't create any sources. To replicate the sha repos => 'main contrib non-free', release => "testing"; } + apt::pin { + "${lsbdistcodename}": + priority => 990; + "${lsbdistcodename}-backports": + priority => 200; + 'buster': + priority => 2; + } + Sadly I can't find a way to iter the next codename from the facts :(. You can either use testing instead of "the next release" or specify it manually. @@ -189,7 +198,12 @@ There are a bunch of new and [interesting facts](https://github.com/puppetlabs/p # Hiera -Here's some sane Hiera config I'm using. +Here's some sane Hiera config I'm using. You'll need to specify a `create_ressources` statement somewhere since `apt::pin` is a define: + +``` +$aptpins = hiera('apt::pin', {}) +create_resources(apt::pin, $aptpins) +``` ``` classes: @@ -206,7 +220,6 @@ apt::purge: apt::sources: "%{facts.lsbdistcodename}": comment: 'Stable' - pin: '990' location: 'http://deb.debian.org/debian/' repos: 'main contrib non-free' "%{facts.lsbdistcodename}-security": @@ -216,16 +229,22 @@ apt::sources: release: "%{facts.lsbdistcodename}/updates" "%{facts.lsbdistcodename}-backports": comment: 'Backports' - pin: 200 location: 'http://deb.debian.org/debian/' repos: 'main contrib non-free' release: "%{facts.lsbdistcodename}-backports" 'buster': comment: 'Buster' - pin: 2 location: 'http://deb.debian.org/debian/' repos: 'main contrib non-free' release: 'buster' + +apt::pin: + "%{facts.lsbdistcodename}": + priority: 990 + "%{facts.lsbdistcodename}-backports": + priority: 200 + 'buster': + priority: 2 needrestart::action: automatic ``` -- cgit v1.2.3