Skip to content

Commit 23cceb2

Browse files
authored
Merge pull request #511 from cultuurnet/feature/newrelic-infra-warnings
Override deprecated /var/run PIDFile location for newrelic infra
2 parents c59af68 + 8cc9214 commit 23cceb2

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

manifests/newrelic/infrastructure.pp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@
88

99
if $license_key {
1010
class { 'profiles::newrelic::infrastructure::install':
11-
version => $version
11+
version => $version,
12+
notify => Class['profiles::newrelic::infrastructure::service']
1213
}
1314

1415
class { 'profiles::newrelic::infrastructure::configuration':
1516
license_key => $license_key,
1617
log_level => $log_level,
17-
attributes => $attributes
18+
attributes => $attributes,
19+
require => Class['profiles::newrelic::infrastructure::install'],
20+
notify => Class['profiles::newrelic::infrastructure::service']
1821
}
1922

2023
class { 'profiles::newrelic::infrastructure::service':
2124
status => $service_status
2225
}
23-
24-
Class['profiles::newrelic::infrastructure::install'] -> Class['profiles::newrelic::infrastructure::configuration']
25-
Class['profiles::newrelic::infrastructure::configuration'] ~> Class['profiles::newrelic::infrastructure::service']
26-
2726
}
2827
}
2928

manifests/newrelic/infrastructure/configuration.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
content => template('profiles/newrelic/infrastructure/newrelic-infra.yml.erb')
1919
}
2020

21+
systemd::dropin_file { 'newrelic-infra_override.conf':
22+
ensure => 'present',
23+
unit => 'newrelic-infra.service',
24+
filename => 'override.conf',
25+
content => "[Service]\nPIDFile=/run/newrelic-infra/newrelic-infra.pid"
26+
}
27+
2128
file { '/etc/newrelic-infra/integrations.d':
2229
ensure => 'directory',
2330
recurse => true,

spec/classes/newrelic/infrastructure/configuration_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
'mode' => '0640'
4545
) }
4646

47+
it { is_expected.to contain_systemd__dropin_file('newrelic-infra_override.conf').with(
48+
'unit' => 'newrelic-infra.service',
49+
'ensure' => 'present',
50+
'filename' => 'override.conf',
51+
'content' => "[Service]\nPIDFile=/run/newrelic-infra/newrelic-infra.pid"
52+
) }
53+
4754
it { is_expected.to contain_file('/etc/newrelic-infra.yml').with_content(/^license_key: my_license_key$/) }
4855
it { is_expected.to contain_file('/etc/newrelic-infra.yml').with_content(/^display_name: mynode.example.com$/) }
4956
it { is_expected.to contain_file('/etc/newrelic-infra.yml').with_content(/^dns_hostname_resolution: false$/) }

spec/classes/newrelic/infrastructure_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
) }
3737

3838
it { is_expected.to contain_class('profiles::newrelic::infrastructure::install').that_comes_before('Class[profiles::newrelic::infrastructure::configuration]') }
39+
it { is_expected.to contain_class('profiles::newrelic::infrastructure::install').that_notifies('Class[profiles::newrelic::infrastructure::service]') }
3940
it { is_expected.to contain_class('profiles::newrelic::infrastructure::configuration').that_notifies('Class[profiles::newrelic::infrastructure::service]') }
4041
end
4142

0 commit comments

Comments
 (0)