From 2a0dfb0fc69ad8d405fc47bcc1e7a927ddea855b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Sep 2019 06:22:45 -0500 Subject: [PATCH] Decide osmo-nightly or -latest from hiera value On some sites we might use nightly, but default to latest. Make sure to delete old osmocmo-*.list file. --- modules/rhizo_base/manifests/apt.pp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/rhizo_base/manifests/apt.pp b/modules/rhizo_base/manifests/apt.pp index c244b57..75951db 100644 --- a/modules/rhizo_base/manifests/apt.pp +++ b/modules/rhizo_base/manifests/apt.pp @@ -17,6 +17,8 @@ class rhizo_base::apt { class rhizo_base::apt::common { + $osmo_repo = hiera('rhizo::osmo_repo', 'latest') + class { '::apt': update => { frequency => 'weekly', @@ -114,14 +116,19 @@ class rhizo_base::apt::debian inherits rhizo_base::apt::common { require => File['/etc/apt/apt.conf.d/90unsigned'], } - apt::source { 'osmocom-latest': - location => 'http://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/', + apt::source { 'osmocom': + location => "http://download.opensuse.org/repositories/network:/osmocom:/${osmo_repo}/Debian_9.0/", release => './', repos => '', notify => Exec['apt_update'], key => { 'id' => '0080689BE757A876CB7DC26962EB1A0917280DDF', - 'source' => 'http://download.opensuse.org/repositories/network:/osmocom:/latest/Debian_9.0/Release.key' + 'source' => "http://download.opensuse.org/repositories/network:/osmocom:/${osmo_repo}/Debian_9.0/Release.key" } } + + file { [ '/etc/apt/sources.list.d/osmocom-latest.list', + '/etc/apt/sources.list.d/osmocom-nightly.list' ]: + ensure => absent, + } }