Merge pull request #367 from mhaskel/deb6_apt-key_workaround

apt-key doesn't add long keys in deb6
This commit is contained in:
Hunter Haugen 2014-10-02 15:37:17 -07:00
commit 873e49478d

View file

@ -64,6 +64,32 @@ describe 'apt_key' do
describe 'ensure =>' do describe 'ensure =>' do
context 'absent' do context 'absent' do
it 'is removed' do
pp = <<-EOS
apt_key { 'centos':
id => '#{CENTOS_GPG_KEY_ID}',
ensure => 'absent',
}
EOS
# Install the key first
shell("apt-key adv --keyserver keyserver.ubuntu.com \
--recv-keys #{CENTOS_GPG_KEY_ID}")
shell("apt-key list | grep #{CENTOS_GPG_KEY_ID}")
# Time to remove it using Puppet
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_failures => true)
shell("apt-key list | grep #{CENTOS_GPG_KEY_ID}",
:acceptable_exit_codes => [1])
shell("apt-key adv --keyserver keyserver.ubuntu.com \
--recv-keys #{CENTOS_GPG_KEY_ID}")
end
end
context 'absent, added with long key', :unless => (fact('operatingsystem') == 'Debian' and fact('operatingsystemmajrelease') == '6') do
it 'is removed' do it 'is removed' do
pp = <<-EOS pp = <<-EOS
apt_key { 'puppetlabs': apt_key { 'puppetlabs':