summaryrefslogtreecommitdiff
path: root/puppet/modules/site_apt/manifests/leap_repo.pp
blob: 1e18b441d2b53f50a2ce955b58dcc22600feea84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# install leap deb repo together with leap-keyring package
# containing the apt signing key
class site_apt::leap_repo {
  $platform = hiera_hash('platform')
  $major_version = $platform['major_version']

  # on jessie, keys need to be in /etc/apt/...
  # see https://0xacab.org/leap/platform/issues/8862
  if ( $::operatingsystemmajrelease == '8' ) {
    if $::site_apt::apt_platform_component =~ /.*(staging|master).*/ {
      $archive_key = 'CE433F407BAB443AFEA196C1837C1AD5367429D9'
    } else {
      $archive_key = '1E453B2CE87BEE2F7DFE99661E34A1828E207901'
    }
  }
  if ( $::operatingsystemmajrelease != '8' ) {
    if $::site_apt::apt_platform_component =~ /.*(staging|master).*/ {
      $archive_key = '/usr/share/keyrings/leap-experimental-archive.gpg'
    } else {
      $archive_key = '/usr/share/keyrings/leap-archive.gpg'
    }
  }

  apt::sources_list { 'leap.list':
    content => "deb [signed-by=${archive_key}] ${::site_apt::apt_url_platform_basic} ${::site_apt::apt_platform_component} ${::site_apt::apt_platform_codename}\n",
    before  => Exec[refresh_apt]
  }

  package { 'leap-archive-keyring':
    ensure => latest
  }

}