puppet/modules/rhizo_base/manifests/apt.pp

165 lines
4.5 KiB
Puppet

# Class: rhizo_base::apt
#
# This module manages the apt repositories
#
# Parameters: none
#
# Actions:
#
# Requires: see Modulefile
#
# Sample Usage:
#
class rhizo_base::apt {
contain "rhizo_base::apt::$lsbdistcodename"
}
class rhizo_base::apt::common {
$osmo_repo = hiera('rhizo::osmo_repo', 'latest')
$fs_version = "${lsbdistcodename}" ? {
'buster' => '1.8.6',
'stretch' => '1.6.20',
}
class { '::apt':
update => {
frequency => 'weekly',
},
}
file { '/etc/apt/apt.conf.d/90unsigned':
ensure => present,
content => 'APT::Get::AllowUnauthenticated "true";',
}
file { '/etc/apt/preferences.d/pinning.pref':
ensure => present,
content => template("rhizo_base/$lsbdistcodename-pinning.pref.erb"),
}
file { '/etc/apt/sources.list.d/freeswitch.list':
ensure => absent,
}
apt::source { 'rhizomatica':
location => 'http://dev.rhizomatica.org/ubuntu/',
release => 'precise',
repos => 'main',
allow_unsigned => true,
include => {
'src' => false,
'deb' => true,
},
require => File['/etc/apt/apt.conf.d/90unsigned'],
}
apt::source { 'rhizo':
location => 'http://repo.rhizomatica.org/ubuntu/',
release => 'precise',
repos => 'main',
allow_unsigned => true,
include => {
'src' => false,
'deb' => true,
},
require => File['/etc/apt/apt.conf.d/90unsigned'],
}
package { 'apt-transport-https':
ensure => installed,
}
apt::key { 'osmocom':
id => '6B2A9F3792D15EB70D4E6A8F86A730B653725973',
source => 'https://downloads.osmocom.org/packages/osmocom:/latest/Debian_10/Release.key',
ensure => refreshed
}
}
class rhizo_base::apt::buster inherits rhizo_base::apt::common {
apt::source { 'irontec':
location => 'http://packages.irontec.com/debian',
release => 'buster',
repos => 'main',
key => {
'id' => '4FF7139B43073A436D8C2C4F90D20F5ED8C20040',
'source' => 'http://packages.irontec.com/public.key'
}
}
apt::source { 'osmocom':
location => "http://downloads.osmocom.org/packages/osmocom:/${osmo_repo}/Debian_10/",
release => './',
repos => '',
key => {
'id' => '6B2A9F3792D15EB70D4E6A8F86A730B653725973',
'source' => 'https://downloads.osmocom.org/packages/osmocom:/latest/Debian_10/Release.key'
},
notify => Exec['apt_update'],
}
apt::source { 'rhizo-buster':
location => 'http://repo.rhizomatica.org/debian/',
release => 'buster',
repos => 'main',
key => {
'id' => '857FD282A0CD2282207556C67DF075856A6A0AD5',
'source' => 'http://repo.rhizomatica.org/debian/repo.key'
}
}
}
class rhizo_base::apt::stretch inherits rhizo_base::apt::common {
apt::source { 'nodesource':
location => 'https://deb.nodesource.com/node_0.10',
release => 'jessie',
repos => 'main',
key => {
'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key'
},
require => Package['apt-transport-https'],
}
apt::source { 'irontec':
location => 'http://packages.irontec.com/debian',
release => 'stretch',
repos => 'main',
key => {
'id' => '4FF7139B43073A436D8C2C4F90D20F5ED8C20040',
'source' => 'http://packages.irontec.com/public.key'
}
}
apt::source { 'rhizo-jessie':
location => 'http://repo.rhizomatica.org/debian/',
release => 'jessie',
repos => 'main',
key => {
'id' => '857FD282A0CD2282207556C67DF075856A6A0AD5',
'source' => 'http://repo.rhizomatica.org/debian/repo.key'
}
}
apt::source { 'rhizo-stretch':
location => 'http://repo.rhizomatica.org/debian/',
release => 'stretch',
repos => 'main',
key => {
'id' => '857FD282A0CD2282207556C67DF075856A6A0AD5',
'source' => 'http://repo.rhizomatica.org/debian/repo.key'
}
}
file { [ '/etc/apt/sources.list.d/osmocom-latest.list',
'/etc/apt/sources.list.d/osmocom-nightly.list',
'/etc/apt/sources.list.d/osmocom.list',
'/etc/apt/sources.list.d/apt.postgresql.org.list' ]:
ensure => absent,
}
}