end
end
- describe 'keyserver_options =>' do
+ describe 'options =>' do
context 'debug' do
it 'works' do
pp = <<-EOS
apt_key { 'puppetlabs':
- id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
- ensure => 'present',
- keyserver_options => 'debug',
+ id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
+ ensure => 'present',
+ options => 'debug',
}
EOS
it 'fails on invalid options' do
pp = <<-EOS
apt_key { 'puppetlabs':
- id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
- ensure => 'present',
- keyserver_options => 'this is totally bonkers',
+ id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
+ ensure => 'present',
+ options => 'this is totally bonkers',
}
EOS
it 'should work with no errors' do
pp = <<-EOS
class { 'apt':
- always_apt_update => true,
- purge_sources_list => true,
- purge_sources_list_d => true,
- purge_preferences => true,
- purge_preferences_d => true,
- update_timeout => '400',
- update_tries => '3',
- sources => {
+ update => {
+ 'frequency' => 'always',
+ 'timeout' => '400',
+ 'tries' => '3',
+ },
+ purge => {
+ 'sources.list' => true,
+ 'sources.list.d' => true,
+ 'preferences' => true,
+ 'preferences.d' => true,
+ },
+ sources => {
'puppetlabs' => {
- 'ensure' => present,
- 'location' => 'http://apt.puppetlabs.com',
- 'repos' => 'main',
- 'key' => '4BD6EC30',
- 'key_server' => 'pgp.mit.edu',
- }
+ 'ensure' => present,
+ 'location' => 'http://apt.puppetlabs.com',
+ 'repos' => 'main',
+ 'key' => {
+ 'id' => '4BD6EC30',
+ 'server' => 'pgp.mit.edu',
+ },
+ },
},
}
EOS