diff options
author | kwadronaut <kwadronaut@puscii.nl> | 2018-09-26 17:36:20 +0200 |
---|---|---|
committer | kwadronaut <kwadronaut@puscii.nl> | 2018-09-26 17:36:20 +0200 |
commit | 118bfb9ba8fc819b99861992c93f665792f94874 (patch) | |
tree | 29c83b322850e36d739d9ef3491049fedfba2dc7 /manifests | |
parent | 3bed48fba6ae35813b8c4413887aba5262c43689 (diff) | |
parent | 145b5238258827702ad3ac4a0a9713981209e1bc (diff) |
Merge remote-tracking branch 'shared/master'
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/params.pp | 2 | ||||
-rw-r--r-- | manifests/preferences.pp | 159 | ||||
-rw-r--r-- | manifests/reboot_required_notify.pp | 2 |
3 files changed, 94 insertions, 69 deletions
diff --git a/manifests/params.pp b/manifests/params.pp index 3879c81..b67a85a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,7 +6,7 @@ class apt::params () { $use_next_release = false $manage_preferences = true $custom_preferences = undef - $debian_url = 'http://httpredir.debian.org/debian/' + $debian_url = 'http://deb.debian.org/debian/' $security_url = 'http://security.debian.org/' $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' $lts_url = $debian_url diff --git a/manifests/preferences.pp b/manifests/preferences.pp index ce28d37..0ec77cf 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -1,110 +1,135 @@ +# Configure basic pins for debian/Ubuntu codenames +# +# This all ensures that apt behaves as expected with regards to packages when +# we have more sources than just the one for the current codenamed release. +# +# This class should not be included directly. It is automatically called in by +# the 'apt' class. Thus you should use the apt class instead. +# class apt::preferences { file { '/etc/apt/preferences': - ensure => absent; + ensure => absent, + } + # Remove the file that we were previously deploying. It's now been renamed to + # current_codename + file { '/etc/apt/preferences.d/stable': + ensure => absent, } if ($apt::manage_preferences == true) and ($apt::custom_preferences != undef) { - - file { - '/etc/apt/preferences.d/custom': - ensure => present, - alias => 'apt_config', - content => template($apt::custom_preferences), - require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; - - '/etc/apt/preferences.d/stable': - ensure => absent; - - '/etc/apt/preferences.d/volatile': - ensure => absent; - - '/etc/apt/preferences.d/lts': - ensure => absent; - - '/etc/apt/preferences.d/nextcodename': - ensure => absent; + file { '/etc/apt/preferences.d/custom': + ensure => present, + alias => 'apt_config', + content => template($apt::custom_preferences), + owner => 'root', + group => 0, + mode => '0644', + require => File['/etc/apt/sources.list'], + } + file { '/etc/apt/preferences.d/current_codename': + ensure => absent, + } + file { '/etc/apt/preferences.d/volatile': + ensure => absent, + } + file { '/etc/apt/preferences.d/lts': + ensure => absent, + } + file { '/etc/apt/preferences.d/nextcodename': + ensure => absent, } } - elsif $apt::manage_preferences == true { - if $::operatingsystem == "Debian" { - - file { - '/etc/apt/preferences.d/stable': - ensure => present, - alias => 'apt_config', - content => template('apt/Debian/stable.erb'), - require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; - - '/etc/apt/preferences.d/custom': - ensure => absent; + if $::operatingsystem == 'Debian' { + file { '/etc/apt/preferences.d/current_codename': + ensure => present, + alias => 'apt_config', + content => template('apt/Debian/current_codename.erb'), + owner => 'root', + group => 0, + mode => '0644', + require => File['/etc/apt/sources.list'], + } + # Cleanup for cases where users might switch from using + # custom_preferences to not using it anymore. + file { '/etc/apt/preferences.d/custom': + ensure => absent, + } + # This file ensures that all debian packages that don't have a + # preference file shouldn't be considered for auto-install or upgrade at + # all. + file { '/etc/apt/preferences.d/debian_fallback': + ensure => present, + source => 'puppet:///modules/apt/Debian/preferences_fallback', + owner => 'root', + group => 0, + mode => '0644', + require => File['/etc/apt/sources.list'], } if $apt::use_volatile { - file { '/etc/apt/preferences.d/volatile': ensure => present, content => template('apt/Debian/volatile.erb'), + owner => 'root', + group => 0, + mode => '0644', require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; } } if $apt::use_lts { - file { '/etc/apt/preferences.d/lts': ensure => present, content => template('apt/Debian/lts.erb'), + owner => 'root', + group => 0, + mode => '0644', require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; } } - if ($::debian_nextcodename) and ($::debian_nextcodename != "experimental") { - + if ($::debian_nextcodename) and ($::debian_nextcodename != 'experimental') { file { '/etc/apt/preferences.d/nextcodename': ensure => present, content => template('apt/Debian/nextcodename.erb'), + owner => 'root', + group => 0, + mode => '0644', require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; } } } - - elsif $::operatingsystem == "Ubuntu" { - + elsif $::operatingsystem == 'Ubuntu' { file { '/etc/apt/preferences': - ensure => present, - alias => 'apt_config', - # only update together - content => template("apt/Ubuntu/preferences_${apt::codename}.erb"), - require => File['/etc/apt/sources.list'], - owner => root, group => 0, mode => '0644'; + ensure => present, + alias => 'apt_config', + # only update together + content => template("apt/Ubuntu/preferences_${apt::codename}.erb"), + owner => 'root', + group => 0, + mode => '0644', + require => File['/etc/apt/sources.list'], } } } - elsif $apt::manage_preferences == false { - - file { - '/etc/apt/preferences.d/custom': - ensure => absent; - - '/etc/apt/preferences.d/stable': - ensure => absent; - - '/etc/apt/preferences.d/volatile': - ensure => absent; - - '/etc/apt/preferences.d/lts': - ensure => absent; - - '/etc/apt/preferences.d/nextcodename': - ensure => absent; + file { '/etc/apt/preferences.d/custom': + ensure => absent, + } + file { '/etc/apt/preferences.d/current_codename': + ensure => absent, + } + file { '/etc/apt/preferences.d/volatile': + ensure => absent, + } + file { '/etc/apt/preferences.d/lts': + ensure => absent, + } + file { '/etc/apt/preferences.d/nextcodename': + ensure => absent, } } } diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index 3463bb4..a538c9a 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -1,6 +1,6 @@ class apt::reboot_required_notify { - if versioncmp($::operatingsystemmajrelease, 8) >= 0 { + if versioncmp($::operatingsystemmajrelease, '8') >= 0 { class { 'apt::reboot_required_notify::jessie': } # Clean up systems that were upgraded from Wheezy or earlier: class { 'apt::reboot_required_notify::wheezy': ensure => absent } |