From: Ashley Penney Date: Tue, 2 Jul 2013 00:28:19 +0000 (-0700) Subject: Merge pull request #138 from hunner/release_111 X-Git-Tag: 1.1.1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cde19bb83e133d477cb4a75f5eb2380fd46ff7ee;hp=1e0e92c1e4e49576f9b83c312d7cc5d9f1303de3;p=puppet-modules%2Fpuppetlabs-apt.git Merge pull request #138 from hunner/release_111 Release 111 --- diff --git a/.travis.yml b/.travis.yml index a19074d..71054bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,26 +4,23 @@ script: "bundle exec rake spec SPEC_OPTS='--format documentation'" rvm: - 1.8.7 - 1.9.3 - - ruby-head + - 2.0.0 env: - - PUPPET_GEM_VERSION="~> 2.6.0" - PUPPET_GEM_VERSION="~> 2.7.0" - PUPPET_GEM_VERSION="~> 3.0.0" - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" matrix: exclude: - - rvm: ruby-head - env: PUPPET_GEM_VERSION="~> 3.0.0" - - rvm: ruby-head - env: PUPPET_GEM_VERSION="~> 3.1.0" - rvm: 1.9.3 env: PUPPET_GEM_VERSION="~> 2.7.0" - - rvm: ruby-head + - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 2.7.0" - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 2.6.0" - - rvm: ruby-head - env: PUPPET_GEM_VERSION="~> 2.6.0" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3.0.0" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3.1.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3.2.0" notifications: email: false diff --git a/Gemfile b/Gemfile index 8e5e04d..881fc90 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,8 @@ -source :rubygems +source 'https://rubygems.org' group :development, :test do + gem 'rake', :require => false + gem 'rspec-puppet', :require => false gem 'puppetlabs_spec_helper', :require => false end diff --git a/manifests/key.pp b/manifests/key.pp index 98a0f3a..b14500e 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -9,6 +9,8 @@ define apt::key ( include apt::params $upkey = upcase($key) + # trim the key to the last 8 chars so we can match longer keys with apt-key list too + $trimmedkey = regsubst($upkey, '^.*(.{8})$', '\1') if $key_content { $method = 'content' @@ -48,7 +50,7 @@ define apt::key ( exec { $digest: command => $digest_command, path => '/bin:/usr/bin', - unless => "/usr/bin/apt-key list | /bin/grep '${upkey}'", + unless => "/usr/bin/apt-key list | /bin/grep '${trimmedkey}'", logoutput => 'on_failure', before => Anchor["apt::key ${upkey} present"], } @@ -66,7 +68,7 @@ define apt::key ( exec { "apt::key ${upkey} absent": command => "apt-key del '${upkey}'", path => '/bin:/usr/bin', - onlyif => "apt-key list | grep '${upkey}'", + onlyif => "apt-key list | grep '${trimmedkey}'", user => 'root', group => 'root', logoutput => 'on_failure',