From d7889cf47b7595396fe88dc9161746e4221f966e Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 14 May 2014 16:28:06 -0400 Subject: [PATCH 01/10] Prepare for 1.5.0. --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ Modulefile | 2 +- metadata.json | 5 +++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10503c9..80e7080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +##2014-05-14 - Supported Release 1.5.0 +###Summary + +This release adds support for Ubuntu 14.04. It also includes many new features +and important bugfixes. One huge change is that apt::key was replaced with +apt_key, which allows you to use puppet resource apt_key to inventory keys on +your system. + +Special thanks to daenney, our intrepid unofficial apt maintainer! + +####Features +- Add support for Ubuntu Trusty! +- Add apt::hold define +- Generate valid *.pref files in apt::pin +- Made pin_priority configurable for apt::backports +- Add apt_key type and provider +- Rename "${apt_conf_d}/proxy" to "${apt_conf_d}/01proxy" +- apt::key rewritten to use apt_key type +- Add support for update_tries to apt::update + +####Bugfixes +- Typo fixes +- Fix unattended upgrades +- Removed bogus line when using purge_preferences +- Fix apt::force to upgrade allow packages to be upgraded to the pacakge from the specified release + ##2014-03-04 - Supported Release 1.4.2 ###Summary diff --git a/Modulefile b/Modulefile index 40a87f4..45169b3 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'puppetlabs-apt' -version '1.4.2' +version '1.5.0' source 'https://github.com/puppetlabs/puppetlabs-apt' author 'Evolving Web / Puppet Labs' license 'Apache License 2.0' diff --git a/metadata.json b/metadata.json index f1e8663..1a18cf8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-apt", - "version": "1.4.1", + "version": "1.5.0", "source": "https://github.com/puppetlabs/puppetlabs-apt", "author": "Puppet Labs", "license": "Apache-2.0", @@ -18,7 +18,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "10.04", - "12.04" + "12.04", + "14.04" ] } ], From f3350663785e9460c4334990c3673b1a9ab40d57 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Thu, 15 May 2014 14:58:49 -0400 Subject: [PATCH 02/10] Claim PE3.3 support. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 1a18cf8..a69a0c0 100644 --- a/metadata.json +++ b/metadata.json @@ -24,7 +24,7 @@ } ], "requirements": [ - { "name": "pe", "version_requirement": "3.2.x" }, + { "name": "pe", "version_requirement": "3.3.x" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [] From b2381c6673a8e86d38232bbef3276de0839b5d86 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 20 May 2014 16:24:28 -0400 Subject: [PATCH 03/10] Fixing lint and adding the trusty nodeset (not sure how that was missed) --- Rakefile | 6 ++++ manifests/init.pp | 2 +- manifests/ppa.pp | 2 +- manifests/unattended_upgrades.pp | 28 +++++++++---------- .../nodesets/ubuntu-server-1404-x64.yml | 11 ++++++++ 5 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 spec/acceptance/nodesets/ubuntu-server-1404-x64.yml diff --git a/Rakefile b/Rakefile index 6d067dc..5868545 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,10 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' +PuppetLint.configuration.fail_on_warnings +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_class_parameter_defaults') +PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] diff --git a/manifests/init.pp b/manifests/init.pp index 48b62d1..5f5d0ac 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -134,7 +134,7 @@ class apt( owner => root, group => root, } - + file { 'old-proxy-file': ensure => absent, path => "${apt_conf_d}/proxy", diff --git a/manifests/ppa.pp b/manifests/ppa.pp index ab79b94..a55e1e0 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -15,7 +15,7 @@ define apt::ppa( } if $::operatingsystem != 'Ubuntu' { - fail("apt::ppa is currently supported on Ubuntu only.") + fail('apt::ppa is currently supported on Ubuntu only.') } $filename_without_slashes = regsubst($name, '/', '-', 'G') diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp index c57a9ee..7e3ccc4 100644 --- a/manifests/unattended_upgrades.pp +++ b/manifests/unattended_upgrades.pp @@ -16,26 +16,26 @@ class apt::unattended_upgrades ( $origins = $::apt::params::origins, $blacklist = [], - $update = "1", - $download = "1", - $upgrade = "1", - $autoclean = "7", + $update = '1', + $download = '1', + $upgrade = '1', + $autoclean = '7', $auto_fix = true, $minimal_steps = false, $install_on_shutdown = false, - $mail_to = "NONE", + $mail_to = 'NONE', $mail_only_on_error = false, $remove_unused = true, $auto_reboot = false, - $dl_limit = "NONE", - $enable = "1", - $backup_interval = "0", - $backup_level = "3", - $max_age = "0", - $min_age = "0", - $max_size = "0", - $download_delta = "0", - $verbose = "0", + $dl_limit = 'NONE', + $enable = '1', + $backup_interval = '0', + $backup_level = '3', + $max_age = '0', + $min_age = '0', + $max_size = '0', + $download_delta = '0', + $verbose = '0', ) inherits ::apt::params { validate_bool( diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml new file mode 100644 index 0000000..cba1cd0 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml @@ -0,0 +1,11 @@ +HOSTS: + ubuntu-server-1404-x64: + roles: + - master + platform: ubuntu-14.04-amd64 + box : puppetlabs/ubuntu-14.04-64-nocm + box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm + hypervisor : vagrant +CONFIG: + log_level : debug + type: git From ba074344fee5cae33ed1d0d32ee4496d0a4884ff Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 21 May 2014 10:39:17 -0700 Subject: [PATCH 04/10] Merge pull request #300 from apenney/fix-tests Block this from running on unsupported platforms. --- spec/acceptance/apt_key_provider_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/apt_key_provider_spec.rb b/spec/acceptance/apt_key_provider_spec.rb index 1d39a97..9becd25 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -7,7 +7,7 @@ CENTOS_GPG_KEY_ID = 'C105B9DE' CENTOS_REPO_URL = 'ftp.cvut.cz/centos' CENTOS_GPG_KEY_FILE = 'RPM-GPG-KEY-CentOS-6' -describe 'apt_key' do +describe 'apt_key', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do before(:each) do shell("apt-key del #{PUPPETLABS_GPG_KEY_ID}", :acceptable_exit_codes => [0,1,2]) From 26ea5cc6f2fe746252908eb2f5097e17dc4dc9ee Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 21 May 2014 19:26:07 -0400 Subject: [PATCH 05/10] Update PE version requirements. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index a69a0c0..7365c67 100644 --- a/metadata.json +++ b/metadata.json @@ -24,7 +24,7 @@ } ], "requirements": [ - { "name": "pe", "version_requirement": "3.3.x" }, + { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [] From 199bd52cf373bfc55f1b31f8721931777472b6c0 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Thu, 29 May 2014 13:07:38 -0400 Subject: [PATCH 06/10] Merge pull request #303 from apenney/fix-ubuntu-10-tests Fix the tests for Ubuntu 10.04. --- spec/acceptance/apt_key_provider_spec.rb | 2 +- spec/acceptance/force_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/apt_key_provider_spec.rb b/spec/acceptance/apt_key_provider_spec.rb index 9becd25..0a31495 100644 --- a/spec/acceptance/apt_key_provider_spec.rb +++ b/spec/acceptance/apt_key_provider_spec.rb @@ -203,7 +203,7 @@ ugVIB2pi+8u84f+an4Hml4xlyijgYu05pqNvnLRyJDLd61hviLC8GYU= EOS apply_manifest(pp, :expect_failures => true) do |r| - expect(r.stderr).to match(/Host not found/) + expect(r.stderr).to match(/(Host not found|Couldn't resolve host)/) end end end diff --git a/spec/acceptance/force_spec.rb b/spec/acceptance/force_spec.rb index a439023..5f4dec3 100644 --- a/spec/acceptance/force_spec.rb +++ b/spec/acceptance/force_spec.rb @@ -59,7 +59,7 @@ describe 'apt::force define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('os it 'should work with no errors' do pp = <<-EOS include apt - apt::force { 'vim': timeout => '1' } + apt::force { 'ocaml': timeout => '1' } EOS shell('apt-get clean') @@ -68,7 +68,7 @@ describe 'apt::force define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('os end end - describe package('vim') do + describe package('ocaml') do it { should_not be_installed } end end From 2a49e41656873fcc5a518d8ab18dbf14062a17b2 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 21 May 2014 19:26:07 -0400 Subject: [PATCH 07/10] Update PE version requirements. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index a69a0c0..7365c67 100644 --- a/metadata.json +++ b/metadata.json @@ -24,7 +24,7 @@ } ], "requirements": [ - { "name": "pe", "version_requirement": "3.3.x" }, + { "name": "pe", "version_requirement": ">= 3.2.0 < 3.4.0" }, { "name": "puppet", "version_requirement": "3.x" } ], "dependencies": [] From ce5d19b3deaf2aa748efb2e5a60fa6cb33f09e4b Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 4 Jun 2014 13:54:22 -0400 Subject: [PATCH 08/10] Remove claims of support. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e7080..bf8553d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -##2014-05-14 - Supported Release 1.5.0 +##2014-06-04 - Release 1.5.0 ###Summary This release adds support for Ubuntu 14.04. It also includes many new features From 6766ed90c6e6f3b5cab0dec80b06792e12fdbf77 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Mon, 9 Jun 2014 11:29:29 -0400 Subject: [PATCH 09/10] Pin rspec to 2.x. --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 1af60fc..78cf9f4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :development, :test do gem 'rake', '10.1.1', :require => false + gem 'rspec', '~> 2.11', :require => false gem 'pry', :require => false gem 'rspec-puppet', :require => false gem 'puppet-lint', :require => false From 1e1c8b287a95014f91f00776b0e36c2dfa7c2c82 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Wed, 11 Jun 2014 13:31:53 -0400 Subject: [PATCH 10/10] Add test case to ensure graceful failure on OSX. --- spec/classes/init_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 120b7e8..c5e938a 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -54,4 +54,16 @@ describe 'apt' do it { should contain_file('puppetlabs.list').with_content(/^deb http:\/\/apt.puppetlabs.com precise main$/) } it { should contain_file('puppetlabs.list').with_content(/^deb-src http:\/\/apt.puppetlabs.com precise main$/) } end + + context 'with unsupported osfamily' do + let :facts do + { :osfamily => 'Darwin', } + end + + it do + expect { + should compile + }.to raise_error(Puppet::Error, /This module only works on Debian or derivatives like Ubuntu/) + end + end end