diff options
author | Raoul Bhatia <raoul@bhatia.at> | 2016-05-28 17:01:25 +0200 |
---|---|---|
committer | Raoul Bhatia <raoul@bhatia.at> | 2016-09-12 13:39:50 +0200 |
commit | 33fabe02547a8c4b15278fe8636d83fe1354f4ae (patch) | |
tree | 2b0d1e4bc60e81075cc939688be4d13f3ba6a8ae | |
parent | cf722ccf9077066a35ab05e5e2f1d9c8302dce16 (diff) |
Ubuntu: Issue EOL warning for unsupported release.
-rw-r--r-- | manifests/params.pp | 8 | ||||
-rw-r--r-- | spec/classes/unattended_upgrades_spec.rb | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/manifests/params.pp b/manifests/params.pp index 007464c..4451bf1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -21,6 +21,7 @@ class unattended_upgrades::params { 'lsbdistid' => $::lsbdistid, 'lsbdistcodename' => $::lsbdistcodename, 'lsbmajdistrelease' => $::lsbmajdistrelease, + 'lsbdistrelease' => $::lsbdistrelease, } } else { # Strict variables facts lookup compatibility @@ -37,6 +38,10 @@ class unattended_upgrades::params { true => $::lsbmajdistrelease, default => undef, }, + 'lsbdistrelease' => defined('$lsbdistrelease') ? { + true => $::lsbdistrelease, + default => undef, + }, } } @@ -71,7 +76,7 @@ class unattended_upgrades::params { ] } - 'trusty', 'utopic', 'vivid', 'wily': { + 'trusty', 'wily': { $legacy_origin = true $origins = [ '${distro_id}:${distro_codename}-security', #lint:ignore:single_quote_string_with_variables @@ -84,6 +89,7 @@ class unattended_upgrades::params { ] } default: { + warning("Ubuntu ${xfacts['lsbdistrelease']} \"${xfacts['lsbdistcodename']}\" has reached End of Life - please upgrade!") $legacy_origin = true $origins = [ '${distro_id}:${distro_codename}-security', #lint:ignore:single_quote_string_with_variables diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb index e0b2263..d927a55 100644 --- a/spec/classes/unattended_upgrades_spec.rb +++ b/spec/classes/unattended_upgrades_spec.rb @@ -271,6 +271,9 @@ describe 'unattended_upgrades' do };/x ) end + # TODO: implement test case for "warning", similar to + # w = 'Ubuntu 15.04 "vivid" has reached End of Life - please upgrade!' + # it_behaves_like 'has_warning', pp, w end context 'with defaults on Ubuntu 15.10 Wily Werewolf' do |