Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Puppet 3.19 KB | None | 0 0
  1. # Manage Debian APT System Repos
  2. class beryjuorg::apt::debian {
  3.  
  4.   if !defined(Class['apt']) {
  5.     class { 'apt':
  6.       purge => {
  7.         'sources.list'   => true,
  8.         'sources.list.d' => true,
  9.         'preferences'    => true,
  10.         'preferences.d'  => true
  11.       }
  12.     }
  13.   }
  14.  
  15.   $parts = split($::trusted['domain'], '\.')
  16.   if size($parts) == 4 {
  17.     $country = "${parts[1]}."
  18.   } else {
  19.     $country = ''
  20.   }
  21.  
  22.   apt::source { "debian-${dist}":
  23.     location => 'http://ftp.debian.org/debian',
  24.     key      => '126C0D24BD8A2942CC7DF8AC7638D0442B90D010',
  25.     repos    => 'main',
  26.     release  => 'stable',
  27.     notify   => Exec['apt_update'],
  28.   }
  29.  
  30.   apt::source { "debian-${dist}-security":
  31.     location => 'http://security.debian.org/',
  32.     key      => 'D21169141CECD440F2EB8DDA9D6D8F6BC857C906',
  33.     repos    => 'main',
  34.     release  => "stable/updates",
  35.     require  => Apt::Source["debian-${dist}"],
  36.   }
  37.  
  38.   apt::source { "debian-${dist}-updates":
  39.     location => 'http://ftp.debian.org/debian',
  40.     key      => '126C0D24BD8A2942CC7DF8AC7638D0442B90D010',
  41.     repos    => 'main',
  42.     release  => 'stable-updates',
  43.     require  => Apt::Source["debian-${dist}-security"],
  44.   }
  45.  
  46.   apt::source { "debian-${dist}-backports":
  47.     location => 'http://ftp.debian.org/debian',
  48.     key      => '126C0D24BD8A2942CC7DF8AC7638D0442B90D010',
  49.     repos    => 'main',
  50.     release  => 'stable-backports',
  51.     require  => Apt::Source["debian-${dist}-updates"],
  52.   }
  53.  
  54.   apt::pin { "${::lsbdistcodename}-backports":
  55.     packages => ['linux*', 'haproxy', 'nginx', 'bacula*', 'nodejs'],
  56.     require  => Apt::Source["debian-${dist}-backports"],
  57.     priority => 500
  58.   }
  59.  
  60.   apt::source { 'beryju.org':
  61.     location => 'http://apt.beryju.org/',
  62.     release  => 'stable',
  63.     repos    => 'beryjuorg',
  64.     key      => {
  65.       'id'     => 'EEB2544FAA2FC778E6C77C994C66B2475FD29847',
  66.       'source' => 'http://apt.beryju.org/public.key',
  67.     },
  68.     require  => Apt::Pin["${::lsbdistcodename}-backports"],
  69.   }
  70.  
  71.   apt::source { 'puppetlabs':
  72.     location => 'http://apt.puppetlabs.com',
  73.     repos    => 'PC1',
  74.     release  => 'jessie',
  75.     key      => {
  76.       'id'     => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
  77.       'source' => 'https://apt.puppetlabs.com/pubkey.gpg',
  78.     },
  79.     require  => Apt::Source['beryju.org'],
  80.   }
  81.  
  82.   apt::source { 'zabbix':
  83.     location => 'http://repo.zabbix.com/zabbix/3.2/debian/',
  84.     repos    => 'main',
  85.     release  => 'jessie',
  86.     key      => {
  87.       'id'     => 'FBABD5FB20255ECAB22EE194D13D58E479EA5ED4',
  88.       'source' => 'http://repo.zabbix.com/zabbix-official-repo.key',
  89.     },
  90.     require  => Apt::Source['puppetlabs'],
  91.   }
  92.  
  93.   # Zabbix repo is managed by zabbix-agent module
  94.  
  95.   exec { 'apt-get-update':
  96.     command     => '/usr/bin/apt-get update',
  97.     refreshonly => true,
  98.     require     => Apt::Source['zabbix'],
  99.   }
  100.  
  101.   package { 'beryjuorg-ca':
  102.     ensure  => 'latest',
  103.     require => Exec['apt-get-update'],
  104.   }
  105.  
  106.   package { 'puppetlabs-release-pc1':
  107.     ensure  => 'latest',
  108.     require => Exec['apt-get-update'],
  109.   }
  110.  
  111.   package { 'linux-image-amd64':
  112.     ensure  => 'latest',
  113.     require => Exec['apt-get-update'],
  114.   }
  115.  
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement