File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626) inherits datadog_agent::params {
2727
2828 if !$skip_apt_key_trusting {
29- ::datadog_agent::ubuntu::install_key { [ $apt_key ]:
30- server => $apt_keyserver ,
31- before => Apt::Source[ ' datadog ' ] ,
29+ $key = {
30+ ' id ' => $apt_key ,
31+ ' server ' => $apt_keyserver ,
3232 }
33+ } else {
34+ $key = {}
3335 }
3436
3537 # This is a hack - I'm not happy about it, but we should rarely
6668 release => $release ,
6769 repos => $repos ,
6870 require => Class[' apt' ],
71+ key => $key ,
6972 notify => Exec[' datadog_apt-get_remove_agent6' ],
7073 }
7174
7780 package { $datadog_agent::params::package_name :
7881 ensure => $agent_version ,
7982 require => [Apt::Source[' datadog' ],
80- Exec[ ' apt_update ' ]],
83+ Class[ ' apt::update ' ]],
8184 }
8285
8386 if $service_provider {
Original file line number Diff line number Diff line change 1717) inherits datadog_agent::params {
1818
1919 if !$skip_apt_key_trusting {
20- ::datadog_agent::ubuntu::install_key { [ $apt_key ]:
21- server => $apt_keyserver ,
22- before => Apt::Source[ ' datadog6 ' ] ,
20+ $key = {
21+ ' id ' => $apt_key ,
22+ ' server ' => $apt_keyserver ,
2323 }
24+ } else {
25+ $key = {}
2426 }
2527
2628 apt::source { 'datadog' :
3335 release => $release ,
3436 repos => $repos ,
3537 require => Class[' apt' ],
38+ key => $key ,
3639 }
3740
3841 package { 'datadog-agent-base' :
4346 package { $datadog_agent::params::package_name :
4447 ensure => $agent_version ,
4548 require => [Apt::Source[' datadog6' ],
46- Exec[ ' apt_update ' ]],
49+ Class[ ' apt::update ' ]],
4750 }
4851
4952 if $service_provider {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1616 end
1717
1818 # it should install the mirror
19- it { should_not contain_datadog_agent__ubuntu__install_key ( ' 935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
19+ it { should_not contain_apt__key ( 'Add key: 935F5A436A5A6E8788F0765B226AE980C7A7DA52 from Apt::Source datadog ') }
2020 it do
21- should contain_datadog_agent__ubuntu__install_key ( ' A2923DFF56EDA6E76E55E492D3A80E30382E94DE' ) \
21+ should contain_apt__key ( 'Add key: A2923DFF56EDA6E76E55E492D3A80E30382E94DE from Apt::Source datadog' )
2222 end
2323 context 'overriding keyserver' do
2424 let ( :params ) { {
2525 apt_keyserver : 'hkp://pool.sks-keyservers.net:80' ,
2626 } }
2727 it do
28- should contain_datadog_agent__ubuntu__install_key ( ' A2923DFF56EDA6E76E55E492D3A80E30382E94DE') \
28+ should contain_apt__key ( 'Add key: A2923DFF56EDA6E76E55E492D3A80E30382E94DE from Apt::Source datadog ') \
2929 . with_server ( 'hkp://pool.sks-keyservers.net:80' )
3030 end
3131 end
32-
32+
3333 it do
3434 should contain_file ( '/etc/apt/sources.list.d/datadog.list' ) \
3535 . that_notifies ( 'exec[apt_update]' )
8787 end
8888
8989 # it should install the mirror
90- it { should_not contain_datadog_agent__ubuntu__install_key ( ' 935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
91- it { should contain_datadog_agent__ubuntu__install_key ( ' A2923DFF56EDA6E76E55E492D3A80E30382E94DE') }
90+ it { should_not contain_apt__key ( 'Add key: 935F5A436A5A6E8788F0765B226AE980C7A7DA52 from Apt::Source datadog6 ') }
91+ it { should contain_apt__key ( 'Add key: A2923DFF56EDA6E76E55E492D3A80E30382E94DE from Apt::Source datadog6 ') }
9292
9393 it do
9494 should contain_file ( '/etc/apt/sources.list.d/datadog6.list' ) \
You can’t perform that action at this time.
0 commit comments