Skip to content

Commit 1b23e69

Browse files
committed
Fixes #32078 - explicitly notify dynflow core service on changes
1 parent aeb026b commit 1b23e69

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

manifests/plugin/dynflow.pp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,32 @@
5050

5151
if $external_core {
5252
foreman_proxy::plugin { 'dynflow_core':
53+
notify => Service['smart_proxy_dynflow_core'],
5354
}
54-
~> file { '/etc/smart_proxy_dynflow_core/settings.yml':
55+
56+
file { '/etc/smart_proxy_dynflow_core/settings.yml':
5557
ensure => file,
5658
content => template('foreman_proxy/plugin/dynflow_core.yml.erb'),
59+
require => Foreman_proxy::Plugin['dynflow_core'],
60+
notify => Service['smart_proxy_dynflow_core'],
5761
}
58-
~> file { '/etc/smart_proxy_dynflow_core/settings.d':
59-
ensure => link,
60-
target => "${foreman_proxy::config_dir}/settings.d",
62+
63+
file { '/etc/smart_proxy_dynflow_core/settings.d':
64+
ensure => link,
65+
target => "${foreman_proxy::config_dir}/settings.d",
66+
require => Foreman_proxy::Plugin['dynflow_core'],
67+
notify => Service['smart_proxy_dynflow_core'],
6168
}
62-
~> systemd::service_limits { 'smart_proxy_dynflow_core.service':
69+
70+
systemd::service_limits { 'smart_proxy_dynflow_core.service':
6371
limits => {
6472
'LimitNOFILE' => $open_file_limit,
6573
},
6674
restart_service => false,
75+
require => Foreman_proxy::Plugin['dynflow_core'],
6776
}
68-
~> service { 'smart_proxy_dynflow_core':
77+
78+
service { 'smart_proxy_dynflow_core':
6979
ensure => running,
7080
enable => true,
7181
}

spec/classes/foreman_proxy__plugin__dynflow_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@
5454
":ssl_private_key: /etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem",
5555
])
5656
end
57+
58+
it 'should restart external core' do
59+
should contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.yml").
60+
that_notifies('Service[smart_proxy_dynflow_core]')
61+
should contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.d").
62+
that_notifies('Service[smart_proxy_dynflow_core]')
63+
end
5764
else
5865
it { should_not contain_foreman_proxy__plugin('dynflow_core') }
5966
it { should_not contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.d") }

0 commit comments

Comments
 (0)