ensure => 'present',
content => 'For posterity: such content, much bogus, wow',
}
ensure => 'present',
content => 'For posterity: such content, much bogus, wow',
}
hkps_protocol_supported = host_inventory['facter']['os']['family'] =~ %r{Ubuntu}i && \
host_inventory['facter']['os']['release']['major'] =~ %r{^18\.04}
hkps_protocol_supported = host_inventory['facter']['os']['family'] =~ %r{Ubuntu}i && \
host_inventory['facter']['os']['release']['major'] =~ %r{^18\.04}
ensure_absent_pp = <<-MANIFEST
apt_key { 'centos':
id => '#{CENTOS_GPG_KEY_LONG_ID}',
ensure => 'absent',
}
ensure_absent_pp = <<-MANIFEST
apt_key { 'centos':
id => '#{CENTOS_GPG_KEY_LONG_ID}',
ensure => 'absent',
}
# Apply the manifest (Retry if timeout error is received from key pool)
retry_on_error_matching do
apply_manifest(gpg_key_pp, catch_failures: true)
# Apply the manifest (Retry if timeout error is received from key pool)
retry_on_error_matching do
apply_manifest(gpg_key_pp, catch_failures: true)
retry_on_error_matching do
apply_manifest(hkp_pool_pp, catch_failures: true)
end
retry_on_error_matching do
apply_manifest(hkp_pool_pp, catch_failures: true)
end
retry_on_error_matching do
apply_manifest(hkps_ubuntu_pp, catch_failures: true)
end
retry_on_error_matching do
apply_manifest(hkps_ubuntu_pp, catch_failures: true)
end
it 'fails' do
apply_manifest(path_bogus_content_pp, expect_failures: true) do |r|
expect(r.stderr).to match(%r{no valid OpenPGP data found})
it 'fails' do
apply_manifest(path_bogus_content_pp, expect_failures: true) do |r|
expect(r.stderr).to match(%r{no valid OpenPGP data found})
describe 'fingerprint validation against source/content' do
context 'with fingerprint in id matches fingerprint from remote key' do
describe 'fingerprint validation against source/content' do
context 'with fingerprint in id matches fingerprint from remote key' do
apply_manifest_twice(fingerprint_match_pp)
end
end
context 'with fingerprint in id does NOT match fingerprint from remote key' do
apply_manifest_twice(fingerprint_match_pp)
end
end
context 'with fingerprint in id does NOT match fingerprint from remote key' do
apply_manifest(fingerprint_does_not_match_pp, expect_failures: true) do |r|
expect(r.stderr).to match(%r{don't match})
end
apply_manifest(fingerprint_does_not_match_pp, expect_failures: true) do |r|
expect(r.stderr).to match(%r{don't match})
end
apply_manifest(refresh_del_key_pp)
apply_manifest(refresh_pp, catch_failures: true)
end
apply_manifest(refresh_del_key_pp)
apply_manifest(refresh_pp, catch_failures: true)
end
context 'when refresh => true' do
it 'updates an expired key' do
apply_manifest(refresh_true_pp)
context 'when refresh => true' do
it 'updates an expired key' do
apply_manifest(refresh_true_pp)
context 'when refresh => false' do
it 'does not replace an expired key' do
apply_manifest(refresh_false_pp)
context 'when refresh => false' do
it 'does not replace an expired key' do
apply_manifest(refresh_false_pp)