From e2ea89aa7a5da2d239fe46d036dfc7fa92e56a03 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 31 Aug 2015 19:55:17 +0000 Subject: reboot_required_notify: move all code to a ::wheezy class. It doesn't work on Jessie and newer (#1). --- manifests/reboot_required_notify.pp | 18 +----------------- manifests/reboot_required_notify/wheezy.pp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 manifests/reboot_required_notify/wheezy.pp (limited to 'manifests') diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index 722e8a5..d0006f3 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -1,21 +1,5 @@ class apt::reboot_required_notify { - # This package installs the script that created /var/run/reboot-required*. - # This script (/usr/share/update-notifier/notify-reboot-required) is - # triggered e.g. by kernel packages. - package { 'update-notifier-common': - ensure => installed, - } - - # cron-apt defaults to run every night at 4 o'clock - # plus some random time <1h. - # so we check if a reboot is required a bit later. - cron { 'apt_reboot_required_notify': - command => 'if [ -f /var/run/reboot-required ]; then echo "Reboot required\n" ; cat /var/run/reboot-required.pkgs ; fi', - user => root, - hour => 5, - minute => 20, - require => Package['update-notifier-common'], - } + class { 'apt::reboot_required_notify::wheezy': } } diff --git a/manifests/reboot_required_notify/wheezy.pp b/manifests/reboot_required_notify/wheezy.pp new file mode 100644 index 0000000..14fdd79 --- /dev/null +++ b/manifests/reboot_required_notify/wheezy.pp @@ -0,0 +1,22 @@ +class apt::reboot_required_notify::wheezy { + + # On Wheezy and older, this package installs the script that created + # /var/run/reboot-required*. + # This script (/usr/share/update-notifier/notify-reboot-required) is + # triggered e.g. by kernel packages. + package { 'update-notifier-common': + ensure => installed, + } + + # cron-apt defaults to run every night at 4 o'clock + # plus some random time <1h. + # so we check if a reboot is required a bit later. + cron { 'apt_reboot_required_notify': + command => 'if [ -f /var/run/reboot-required ]; then echo "Reboot required\n" ; cat /var/run/reboot-required.pkgs ; fi', + user => root, + hour => 5, + minute => 20, + require => Package['update-notifier-common'], + } + +} -- cgit v1.2.3 From a82e3ae272c8510b3dc30f499316a7bfb518d330 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 31 Aug 2015 19:56:16 +0000 Subject: reboot_required_notify::wheezy: add an "ensure" parameter, defaulting to "present". --- manifests/reboot_required_notify/wheezy.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/reboot_required_notify/wheezy.pp b/manifests/reboot_required_notify/wheezy.pp index 14fdd79..06998ef 100644 --- a/manifests/reboot_required_notify/wheezy.pp +++ b/manifests/reboot_required_notify/wheezy.pp @@ -1,17 +1,18 @@ -class apt::reboot_required_notify::wheezy { +class apt::reboot_required_notify::wheezy ($ensure = present) { # On Wheezy and older, this package installs the script that created # /var/run/reboot-required*. # This script (/usr/share/update-notifier/notify-reboot-required) is # triggered e.g. by kernel packages. package { 'update-notifier-common': - ensure => installed, + ensure => $ensure, } # cron-apt defaults to run every night at 4 o'clock # plus some random time <1h. # so we check if a reboot is required a bit later. cron { 'apt_reboot_required_notify': + ensure => $ensure, command => 'if [ -f /var/run/reboot-required ]; then echo "Reboot required\n" ; cat /var/run/reboot-required.pkgs ; fi', user => root, hour => 5, -- cgit v1.2.3 From 3630285006d9fb60c5fbecebc976623c37dd1395 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 31 Aug 2015 20:01:22 +0000 Subject: reboot_required_notify: add initial support for Jessie and newer. Note that reboot-notifier is only in stretch/sid at the moment, so to use this one needs to configure APT pinning themselves to make this package installable. --- manifests/reboot_required_notify.pp | 15 ++++++++++++++- manifests/reboot_required_notify/jessie.pp | 13 +++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 manifests/reboot_required_notify/jessie.pp (limited to 'manifests') diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index d0006f3..82466d2 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -1,5 +1,18 @@ class apt::reboot_required_notify { - class { 'apt::reboot_required_notify::wheezy': } + $jessie_or_newer = $::operatingsystemmajrelease ? { + 5 => false, + 6 => false, + 7 => false, + default => true, + } + + if $jessie_or_newer { + class { 'apt::reboot_required_notify::jessie': } + # Clean up systems that were upgraded from Wheezy or earlier: + class { 'apt::reboot_required_notify::wheezy': ensure => absent } + } else { + class { 'apt::reboot_required_notify::wheezy': } + } } diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp new file mode 100644 index 0000000..51b75a2 --- /dev/null +++ b/manifests/reboot_required_notify/jessie.pp @@ -0,0 +1,13 @@ +class apt::reboot_required_notify::jessie ($ensure = present) { + + # On Jessie and newer, this package installs the script that created + # /var/run/reboot-required*. + # This script (/usr/share/update-notifier/notify-reboot-required) is + # triggered e.g. by kernel packages. + # This package also sends a daily email to the administrator when a system + # reboot is required, e.g. due to a kernel update. + package { 'reboot-notifier': + ensure => $ensure, + } + +} -- cgit v1.2.3 From 48bf4a390e7fc2d7fa948ca1c441785880f4c22b Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Wed, 7 Oct 2015 10:36:12 -0400 Subject: Merge Debian squeeze, wheezy, jessie and sid preferences templates into one --- manifests/preferences.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/preferences.pp b/manifests/preferences.pp index 9ed24c1..50ca23a 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -2,7 +2,10 @@ class apt::preferences { $pref_contents = $apt::custom_preferences ? { '' => $::operatingsystem ? { - 'debian' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"), + 'debian' => $::debian_codename ? { + 'lenny' => template("apt/${::operatingsystem}/preferences_lenny.erb"), + default => template("apt/${::operatingsystem}/preferences.erb"), + }, 'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"), }, default => $apt::custom_preferences -- cgit v1.2.3 From e70a6712d31e91ecbf71f4de841735c3b36193ba Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 16 Mar 2016 14:26:52 +0000 Subject: apt::reboot_required_notify::jessie: manage APT pinning to fetch reboot-notifier from jessie-backports, when running on Jessie. --- manifests/reboot_required_notify/jessie.pp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp index 51b75a2..9b5a0c0 100644 --- a/manifests/reboot_required_notify/jessie.pp +++ b/manifests/reboot_required_notify/jessie.pp @@ -1,5 +1,15 @@ class apt::reboot_required_notify::jessie ($ensure = present) { + $pinning_ensure = $::operatingsystemmajrelease ? { + 8 => present, + default => absent, + } + apt::preferences_snippet { 'reboot-notifier': + ensure => $pinning_ensure, + pin => 'release o=Debian Backports,a=jessie-backports', + priority => 991, + } + # On Jessie and newer, this package installs the script that created # /var/run/reboot-required*. # This script (/usr/share/update-notifier/notify-reboot-required) is @@ -7,7 +17,8 @@ class apt::reboot_required_notify::jessie ($ensure = present) { # This package also sends a daily email to the administrator when a system # reboot is required, e.g. due to a kernel update. package { 'reboot-notifier': - ensure => $ensure, + ensure => $ensure, + require => Apt::Preferences_snippet['reboot-notifier'], } - + } -- cgit v1.2.3 From 770f8fb5dafa442bc018fa95fcab2fb60d817020 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sat, 3 Oct 2015 01:13:50 -0400 Subject: make backports_url follow debian_url by default backports_url was already set to the same value than debian_url by default, but it was set to the default value of debian_url. this meant that when giving a url to the debian_url parameter to the apt class, the backports_url would not follow and would still be using the default value for debian_url. with this change, when backports_url is not specified, but debian_url is, then both of them take on the value given to the debian_url. of course if backports_url is also given a value, then it keeps the value given by the user. --- manifests/init.pp | 9 +++++++-- manifests/params.pp | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 4c44af2..9c186cc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -35,6 +35,11 @@ class apt( } } + $real_backports_url = $backports_url ? { + false => $debian_url, + default => $backports_url, + } + package { 'apt': ensure => installed, require => undef, @@ -99,12 +104,12 @@ class apt( if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { apt::sources_list { 'backports': - content => "deb $backports_url ${::debian_codename}-backports ${apt::real_repos}", + content => "deb ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", } if $include_src { apt::sources_list { 'backports-src': - content => "deb-src $backports_url ${::debian_codename}-backports ${apt::real_repos}", + content => "deb-src ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", } } } diff --git a/manifests/params.pp b/manifests/params.pp index 28af06e..be7262d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,10 +9,7 @@ class apt::params () { $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' $backports_url = $::debian_codename ? { 'squeeze' => 'http://backports.debian.org/debian-backports/', - default => $::operatingsystem ? { - 'Ubuntu' => $ubuntu_url, - default => $debian_url, - } + default => false, } $lts_url = $debian_url $volatile_url = 'http://volatile.debian.org/debian-volatile/' -- cgit v1.2.3 From 0752201ce40e7bf4a9acdf642b455e1d97e8789f Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sat, 3 Oct 2015 01:18:07 -0400 Subject: push logic behind apt::repos back in apt::params The logic in specifying the default value for apt::repos is in the wrong place: it should be in apt::params since this is exactly what this latter class is for. There's no special case that can involve making default the value follow the value of another parameter so there's no point in having that logic in the main class. --- manifests/init.pp | 14 -------------- manifests/params.pp | 12 +++++++++++- 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 9c186cc..46e5cb0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,20 +20,6 @@ class apt( $custom_sources_list = '', $custom_key_dir = $apt::params::custom_key_dir ) inherits apt::params { - case $::operatingsystem { - 'debian': { - $real_repos = $repos ? { - 'auto' => 'main contrib non-free', - default => $repos, - } - } - 'ubuntu': { - $real_repos = $repos ? { - 'auto' => 'main restricted universe multiverse', - default => $repos, - } - } - } $real_backports_url = $backports_url ? { false => $debian_url, diff --git a/manifests/params.pp b/manifests/params.pp index be7262d..a70dac1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -13,7 +13,17 @@ class apt::params () { } $lts_url = $debian_url $volatile_url = 'http://volatile.debian.org/debian-volatile/' - $repos = 'auto' + case $::operatingsystem { + 'debian': { + $repos = 'main contrib non-free' + } + 'ubuntu': { + $repos = 'main restricted universe multiverse' + } + default: { + fail("Unsupported system '${::operatingsystem}'.") + } + } $custom_preferences = '' $custom_key_dir = false } -- cgit v1.2.3 From 2bbfe8cab9ba8125feb9f54865e3025bf4d355ee Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 29 Jun 2016 17:31:14 +0200 Subject: Fix some minor lint issues This was shown by the testing that was added in merge request !34 --- manifests/preseeded_package.pp | 5 ++++- manifests/sources_list.pp | 5 ++++- manifests/upgrade_package.pp | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/preseeded_package.pp b/manifests/preseeded_package.pp index 3ef0687..162ade7 100644 --- a/manifests/preseeded_package.pp +++ b/manifests/preseeded_package.pp @@ -1,3 +1,4 @@ +# Install a package with a preseed file to automatically answer some questions. define apt::preseeded_package ( $ensure = 'installed', $content = '' @@ -10,7 +11,9 @@ define apt::preseeded_package ( file { $seedfile: content => $real_content, - mode => '0600', owner => root, group => root, + mode => '0600', + owner => 'root', + group => 0, } package { $name: diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 0ee068d..7565bce 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -1,3 +1,4 @@ +# Configure an apt source define apt::sources_list ( $ensure = 'present', $source = '', @@ -22,7 +23,9 @@ define apt::sources_list ( # apparently doesn't. file { "/etc/apt/sources.list.d/${realname}.list": ensure => $ensure, - owner => root, group => 0, mode => '0644', + mode => '0644', + owner => 'root', + group => 0, notify => Exec['apt_updated'], } diff --git a/manifests/upgrade_package.pp b/manifests/upgrade_package.pp index 30572c9..e61b15d 100644 --- a/manifests/upgrade_package.pp +++ b/manifests/upgrade_package.pp @@ -1,3 +1,5 @@ +# Install a package either to a certain version, or while making sure that it's +# always the latest version that's installed. define apt::upgrade_package ( $version = '' ) { @@ -23,7 +25,7 @@ define apt::upgrade_package ( } exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}": - onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ], + onlyif => [ "grep-status -F Status installed -a -P ${name} -q", "apt-show-versions -u ${name} | grep -q upgradeable" ], require => Package['apt-show-versions', 'dctrl-tools'], before => Exec['apt_updated'] } -- cgit v1.2.3 From 5102b7863b09e58bdd712c9019885313270299ce Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 15:49:22 +0000 Subject: Drop apt::cron::download, and turn $apt_cron_hours into a class parameter for apt::cron::dist_upgrade. I've introduced apt::cron::download, am not using it anymore, and have never seen anyone else submit a bug or a merge request for it. Thus, I feel pretty confident in dropping it. And this allows me to trivially get rid of the $apt_cron_hours global variable noticed by LeLutin in #13. --- manifests/cron/base.pp | 20 -------------------- manifests/cron/dist_upgrade.pp | 21 ++++++++++++++++++++- manifests/cron/download.pp | 27 --------------------------- 3 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 manifests/cron/base.pp delete mode 100644 manifests/cron/download.pp (limited to 'manifests') diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp deleted file mode 100644 index 39fc306..0000000 --- a/manifests/cron/base.pp +++ /dev/null @@ -1,20 +0,0 @@ -class apt::cron::base { - - package { 'cron-apt': ensure => installed } - - case $apt_cron_hours { - '': {} - default: { - # cron-apt defaults to run every night at 4 o'clock - # so we try not to run at the same time. - cron { 'apt_cron_every_N_hours': - command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt', - user => root, - hour => "${apt_cron_hours}", - minute => 10, - require => Package['cron-apt'], - } - } - } - -} diff --git a/manifests/cron/dist_upgrade.pp b/manifests/cron/dist_upgrade.pp index 74403bb..e1a03ed 100644 --- a/manifests/cron/dist_upgrade.pp +++ b/manifests/cron/dist_upgrade.pp @@ -1,4 +1,23 @@ -class apt::cron::dist_upgrade inherits apt::cron::base { +class apt::cron::dist_upgrade ( + $cron_hours = '', +) { + + package { 'cron-apt': ensure => installed } + + case $cron_hours { + '': {} + default: { + # cron-apt defaults to run every night at 4 o'clock + # so we try not to run at the same time. + cron { 'apt_cron_every_N_hours': + command => 'test -x /usr/sbin/cron-apt && /usr/sbin/cron-apt', + user => root, + hour => "${cron_hours}", + minute => 10, + require => Package['cron-apt'], + } + } + } $action = "autoclean -y dist-upgrade -y -o APT::Get::Show-Upgraded=true -o 'DPkg::Options::=--force-confold' diff --git a/manifests/cron/download.pp b/manifests/cron/download.pp deleted file mode 100644 index 4a19fec..0000000 --- a/manifests/cron/download.pp +++ /dev/null @@ -1,27 +0,0 @@ -class apt::cron::download inherits apt::cron::base { - - $action = "autoclean -y -dist-upgrade -d -y -o APT::Get::Show-Upgraded=true -" - - file { '/etc/cron-apt/action.d/4-dist-upgrade': - ensure => absent, - } - - file { '/etc/cron-apt/action.d/3-download': - content => $action, - require => Package[cron-apt], - owner => root, - group => 0, - mode => '0644'; - } - - file { '/etc/cron-apt/config.d/MAILON': - content => "MAILON=changes\n", - require => Package[cron-apt], - owner => root, - group => 0, - mode => '0644'; - } - -} -- cgit v1.2.3 From 195ed5d31bf5dabd5efe4460127002351499eac2 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 17:39:14 +0000 Subject: apt::dist_upgrade: add a timeout parameter (#8). --- manifests/dist_upgrade.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index 19c031e..e5475fc 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -1,8 +1,13 @@ -class apt::dist_upgrade { +# Parameters: +# - timeout: specified in seconds +class apt::dist_upgrade ( + $timeout = 300, +) { exec { 'apt_dist-upgrade': command => '/usr/bin/apt-get -q -y -o \'DPkg::Options::=--force-confold\' dist-upgrade', refreshonly => true, + timeout => $timeout, before => Exec['apt_updated'] } -- cgit v1.2.3 From 89a024678e39fec8a5c05371bcceaece605fbd88 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 17:54:16 +0000 Subject: apt::reboot_required_notify::jessie: explicitly check that $apt::use_backports is true when running Jessie. Otherwise, it would fail anyway when trying to install reboot-notifier, but in a way less user-friendly. Thanks to lavamind for the suggestion! --- manifests/reboot_required_notify/jessie.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests') diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp index 9b5a0c0..2de6b62 100644 --- a/manifests/reboot_required_notify/jessie.pp +++ b/manifests/reboot_required_notify/jessie.pp @@ -1,5 +1,9 @@ class apt::reboot_required_notify::jessie ($ensure = present) { + if $::operatingsystemmajrelease == 8 and ! $::apt::use_backports { + fail('apt::reboot_required_notify requires $apt::use_backports on Jessie') + } + $pinning_ensure = $::operatingsystemmajrelease ? { 8 => present, default => absent, -- cgit v1.2.3 From 70118955f6dae59a021880865408cf9367c3dc57 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 17:56:40 +0000 Subject: apt::reboot_required_notify: get rid of temporary variable. --- manifests/reboot_required_notify.pp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'manifests') diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp index 82466d2..efd8aeb 100644 --- a/manifests/reboot_required_notify.pp +++ b/manifests/reboot_required_notify.pp @@ -1,13 +1,6 @@ class apt::reboot_required_notify { - $jessie_or_newer = $::operatingsystemmajrelease ? { - 5 => false, - 6 => false, - 7 => false, - default => true, - } - - if $jessie_or_newer { + 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 } -- cgit v1.2.3 From 13cb9fb48538fc7eed9b2f924aa4c84dd1434e3b Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 18:49:23 +0000 Subject: Move documentation to README, and expand a bit on it. --- manifests/dist_upgrade.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests') diff --git a/manifests/dist_upgrade.pp b/manifests/dist_upgrade.pp index e5475fc..3061fb8 100644 --- a/manifests/dist_upgrade.pp +++ b/manifests/dist_upgrade.pp @@ -1,5 +1,3 @@ -# Parameters: -# - timeout: specified in seconds class apt::dist_upgrade ( $timeout = 300, ) { -- cgit v1.2.3 From e876cd25b56b208b3a3b1bc1ce317338213cf45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Wed, 29 Jun 2016 20:06:20 +0200 Subject: Remove redundant symlinks for the Debian listchanges template, fixes #2 --- manifests/listchanges.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/listchanges.pp b/manifests/listchanges.pp index e64bb1b..ecbbe6d 100644 --- a/manifests/listchanges.pp +++ b/manifests/listchanges.pp @@ -1,6 +1,6 @@ class apt::listchanges( $ensure_version = 'installed', - $config = "apt/${::operatingsystem}/listchanges_${::debian_codename}.erb", + $config = "apt/${::operatingsystem}/listchanges.erb", $frontend = 'mail', $email = 'root', $confirm = '0', -- cgit v1.2.3 From 6c0c1f4a1625d44e28fe6c150988be27c2bb4694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Wed, 29 Jun 2016 20:46:11 +0200 Subject: Remove redundant symlinks for the Debian apticron template, fixes #2 --- manifests/apticron.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/apticron.pp b/manifests/apticron.pp index 9c94f9c..89709a8 100644 --- a/manifests/apticron.pp +++ b/manifests/apticron.pp @@ -1,6 +1,6 @@ class apt::apticron( $ensure_version = 'installed', - $config = "apt/${::operatingsystem}/apticron_${::debian_codename}.erb", + $config = "apt/${::operatingsystem}/apticron.erb", $email = 'root', $diff_only = '1', $listchanges_profile = 'apticron', -- cgit v1.2.3 From 98b4be5570064e8f6a962b11a3f48dc7834241a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Wed, 29 Jun 2016 21:49:21 +0200 Subject: Drop Debian lenny and squeeze support. --- manifests/init.pp | 13 ++----------- manifests/preferences.pp | 5 +---- 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 46e5cb0..2ee4d10 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,7 +11,6 @@ class apt( $use_next_release = $apt::params::use_next_release, $debian_url = $apt::params::debian_url, $security_url = $apt::params::security_url, - $backports_url = $apt::params::backports_url, $lts_url = $apt::params::lts_url, $volatile_url = $apt::params::volatile_url, $ubuntu_url = $apt::params::ubuntu_url, @@ -21,11 +20,6 @@ class apt( $custom_key_dir = $apt::params::custom_key_dir ) inherits apt::params { - $real_backports_url = $backports_url ? { - false => $debian_url, - default => $backports_url, - } - package { 'apt': ensure => installed, require => undef, @@ -84,18 +78,15 @@ class apt( ## This package should really always be current package { 'debian-archive-keyring': ensure => latest } - # backports uses the normal archive key now - package { 'debian-backports-keyring': ensure => absent } - if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) { apt::sources_list { 'backports': - content => "deb ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", + content => "deb ${debian_url} ${::debian_codename}-backports ${apt::repos}", } if $include_src { apt::sources_list { 'backports-src': - content => "deb-src ${real_backports_url} ${::debian_codename}-backports ${apt::repos}", + content => "deb-src ${debian_url} ${::debian_codename}-backports ${apt::repos}", } } } diff --git a/manifests/preferences.pp b/manifests/preferences.pp index 50ca23a..aedd56b 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -2,10 +2,7 @@ class apt::preferences { $pref_contents = $apt::custom_preferences ? { '' => $::operatingsystem ? { - 'debian' => $::debian_codename ? { - 'lenny' => template("apt/${::operatingsystem}/preferences_lenny.erb"), - default => template("apt/${::operatingsystem}/preferences.erb"), - }, + 'debian' => template("apt/${::operatingsystem}/preferences.erb"), 'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"), }, default => $apt::custom_preferences -- cgit v1.2.3 From e55da5b7b803d34efc28c3c019269ff57958e7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Thu, 30 Jun 2016 21:19:01 +0200 Subject: Remove backports_url parameter. For jessie and later releases, backports use debian_url. --- manifests/params.pp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'manifests') diff --git a/manifests/params.pp b/manifests/params.pp index a70dac1..2b18eb5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,10 +7,6 @@ class apt::params () { $debian_url = 'http://httpredir.debian.org/debian/' $security_url = 'http://security.debian.org/' $ubuntu_url = 'http://archive.ubuntu.com/ubuntu' - $backports_url = $::debian_codename ? { - 'squeeze' => 'http://backports.debian.org/debian-backports/', - default => false, - } $lts_url = $debian_url $volatile_url = 'http://volatile.debian.org/debian-volatile/' case $::operatingsystem { -- cgit v1.2.3 From 328a6215a3a7728b39bbebc6a85d6371a23b9301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Charaoui?= Date: Thu, 30 Jun 2016 21:20:51 +0200 Subject: Take out comment referencing squeeze, see issue #14 --- manifests/init.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 2ee4d10..4bf126c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -67,8 +67,6 @@ class apt( include apt::preferences::absent } default: { - # When squeeze becomes the stable branch, transform this file's header - # into a preferences.d file include apt::preferences } } -- cgit v1.2.3 From 6baa09d71eac070cbe2bd71afb27064bef7c809d Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 3 Nov 2016 00:09:25 +0100 Subject: Scope defines of apt_conf --- manifests/init.pp | 6 +++--- manifests/proxy_client.pp | 2 +- manifests/unattended_upgrades.pp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index 4bf126c..3d93d22 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -40,14 +40,14 @@ class apt( mode => '0644'; } - apt_conf { '02show_upgraded': + ::apt::apt_conf { '02show_upgraded': source => [ "puppet:///modules/site_apt/${::fqdn}/02show_upgraded", 'puppet:///modules/site_apt/02show_upgraded', 'puppet:///modules/apt/02show_upgraded' ] } if ( $::virtual == 'vserver' ) { - apt_conf { '03clean_vserver': + ::apt::apt_conf { '03clean_vserver': source => [ "puppet:///modules/site_apt/${::fqdn}/03clean_vserver", 'puppet:///modules/site_apt/03clean_vserver', 'puppet:///modules/apt/03clean_vserver' ], @@ -55,7 +55,7 @@ class apt( } } else { - apt_conf { '03clean': + ::apt::apt_conf { '03clean': source => [ "puppet:///modules/site_apt/${::fqdn}/03clean", 'puppet:///modules/site_apt/03clean', 'puppet:///modules/apt/03clean' ] diff --git a/manifests/proxy_client.pp b/manifests/proxy_client.pp index 9ba79f2..e7972f7 100644 --- a/manifests/proxy_client.pp +++ b/manifests/proxy_client.pp @@ -3,7 +3,7 @@ class apt::proxy_client( $port = '3142', ){ - apt_conf { '20proxy': + ::apt::apt_conf { '20proxy': content => template('apt/20proxy.erb'), } } diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index 52d7542..d604125 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -26,7 +26,7 @@ class apt::unattended_upgrades ( default => $config_content } - apt_conf { '50unattended-upgrades': + ::apt::apt_conf { '50unattended-upgrades': content => $file_content, require => Package['unattended-upgrades'], refresh_apt => false -- cgit v1.2.3 From 04c73a73d46ccea8df6cce145ed6a516d2150d3a Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 3 Nov 2016 00:45:34 +0100 Subject: Use undef as default for source parameter --- manifests/apt_conf.pp | 6 +++--- manifests/sources_list.pp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/apt_conf.pp b/manifests/apt_conf.pp index 949f615..fa8cfa3 100644 --- a/manifests/apt_conf.pp +++ b/manifests/apt_conf.pp @@ -1,15 +1,15 @@ define apt::apt_conf( $ensure = 'present', - $source = '', + $source = undef, $content = undef, $refresh_apt = true ) { - if $source == '' and $content == undef { + if $source == undef and $content == undef { fail("One of \$source or \$content must be specified for apt_conf ${name}") } - if $source != '' and $content != undef { + if $source != undef and $content != undef { fail("Only one of \$source or \$content must specified for apt_conf ${name}") } diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp index 7565bce..6ff4fc3 100644 --- a/manifests/sources_list.pp +++ b/manifests/sources_list.pp @@ -1,15 +1,15 @@ # Configure an apt source define apt::sources_list ( - $ensure = 'present', - $source = '', + $ensure = 'present', + $source = undef, $content = undef ) { if $ensure == 'present' { - if $source == '' and $content == undef { + if $source == undef and $content == undef { fail("One of \$source or \$content must be specified for apt_sources_snippet ${name}") } - if $source != '' and $content != undef { + if $source != undef and $content != undef { fail("Only one of \$source or \$content must specified for apt_sources_snippet ${name}") } } -- cgit v1.2.3 From c7581a1f0e2b64b186a2d7c37e7ba0a9fa2cc1df Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 3 Nov 2016 15:54:46 +0100 Subject: Fix preferences_snippet.pp for puppet 4 --- manifests/preferences_snippet.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests') diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp index b7dba0d..2b2fb74 100644 --- a/manifests/preferences_snippet.pp +++ b/manifests/preferences_snippet.pp @@ -2,9 +2,9 @@ define apt::preferences_snippet ( $priority = undef, $package = false, $ensure = 'present', - $source = '', - $release = '', - $pin = '' + $source = undef, + $release = undef, + $pin = undef ) { $real_package = $package ? { @@ -36,9 +36,9 @@ define apt::preferences_snippet ( } case $source { - '': { + undef: { case $release { - '': { + undef: { File["/etc/apt/preferences.d/${name}"]{ content => template('apt/preferences_snippet.erb') } -- cgit v1.2.3