Skip to content

Commit

Permalink
Fixes #32078 - explicitly notify dynflow core service on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Mar 16, 2021
1 parent aeb026b commit 763aba8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
23 changes: 17 additions & 6 deletions manifests/plugin/dynflow.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,33 @@

if $external_core {
foreman_proxy::plugin { 'dynflow_core':
notify => Service['smart_proxy_dynflow_core'],
}
~> file { '/etc/smart_proxy_dynflow_core/settings.yml':

file { '/etc/smart_proxy_dynflow_core/settings.yml':
ensure => file,
content => template('foreman_proxy/plugin/dynflow_core.yml.erb'),
require => Foreman_proxy::Plugin['dynflow_core'],
notify => Service['smart_proxy_dynflow_core'],
}
~> file { '/etc/smart_proxy_dynflow_core/settings.d':
ensure => link,
target => "${foreman_proxy::config_dir}/settings.d",

file { '/etc/smart_proxy_dynflow_core/settings.d':
ensure => link,
target => "${foreman_proxy::config_dir}/settings.d",
require => Foreman_proxy::Plugin['dynflow_core'],
notify => Service['smart_proxy_dynflow_core'],
}
~> systemd::service_limits { 'smart_proxy_dynflow_core.service':

systemd::service_limits { 'smart_proxy_dynflow_core.service':
limits => {
'LimitNOFILE' => $open_file_limit,
},
restart_service => false,
require => Foreman_proxy::Plugin['dynflow_core'],
notify => Service['smart_proxy_dynflow_core'],
}
~> service { 'smart_proxy_dynflow_core':

service { 'smart_proxy_dynflow_core':
ensure => running,
enable => true,
}
Expand Down
7 changes: 7 additions & 0 deletions spec/classes/foreman_proxy__plugin__dynflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@
":ssl_private_key: /etc/puppetlabs/puppet/ssl/private_keys/foo.example.com.pem",
])
end

it 'should restart external core' do
should contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.yml").
that_notifies('Service[smart_proxy_dynflow_core]')
should contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.d").
that_notifies('Service[smart_proxy_dynflow_core]')
end
else
it { should_not contain_foreman_proxy__plugin('dynflow_core') }
it { should_not contain_file("#{etc_dir}/smart_proxy_dynflow_core/settings.d") }
Expand Down

0 comments on commit 763aba8

Please sign in to comment.