puppet-systemd
puppet-systemd copied to clipboard
Unit_file: Add notify_service
Pull Request (PR) description
Hello,
I had add new parameters for Unit_file define, notify_service
. This params I can use for disable the service notify. Very useful for not restart an in memory service for space or a new comment.
I've try to add spec but that not work. I've try something like that:
context 'notify_service => false' do
let(:params) { { enable: true, notify_service: false } }
it do
expect(subject).to contain_service(title).
without_subscribes_to("File[/etc/systemd/system/#{title}]")
end
end
or
context 'notify_service => false' do
let(:params) { { enable: true, notify_service: false } }
it do
expect(subject).to contain_file("/etc/systemd/system/#{title}").
without_notifies("Service[#{title}]")
end
end
Can you help me for this part ?
This Pull Request (PR) fixes the following issues
Regards,
I think there's no such thing as without_notifies
or without_subscribes_to
. The closest I can think of is
it { is_expected.not_to contain_service(title).with_subscribes_to("File[/etc/systemd/system/#{title}]")
Slight nuance is that it's also true if the service is not contained in the catalog. Perhaps a possible enhancement for https://github.com/puppetlabs/rspec-puppet?
Hello @ekohl
Thank it's look good !
I've also create an issue here https://github.com/puppetlabs/rspec-puppet/issues/28
Regards,
implemented in https://github.com/voxpupuli/puppet-systemd/pull/433