File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 6464# @param daemon_reload
6565# call `systemd::daemon-reload` to ensure that the modified unit file is loaded
6666#
67+ # @param notify_service
68+ # Notify service if systemd file is changed
69+ #
6770# @example manage unit file + service
6871# systemd::unit_file { 'foo.service':
6972# content => file("${module_name}/foo.service"),
8891 Optional[Boolean] $hasstatus = undef ,
8992 Boolean $selinux_ignore_defaults = false ,
9093 Hash[String[1], Any] $service_parameters = {},
91- Boolean $daemon_reload = true
94+ Boolean $daemon_reload = true ,
95+ Boolean $notify_service = true ,
9296) {
9397 include systemd
9498
152156 }
153157 Service[$name ] -> File [" ${path} /${name} " ]
154158 } else {
155- File [" ${path} /${name} " ] ~> Service[$name ]
159+ if $notify_service {
160+ File [" ${path} /${name} " ] ~> Service[$name ]
161+ } else {
162+ File [" ${path} /${name} " ] -> Service[$name ]
163+ }
156164
157165 if $daemon_reload {
158166 Systemd::Daemon_reload[$name ] ~> Service[$name ]
Original file line number Diff line number Diff line change 267267 expect ( subject ) . not_to create_systemd__daemon_reload ( title )
268268 }
269269 end
270+
271+ context 'notify_service => false' do
272+ let ( :params ) { { enable : true , notify_service : false } }
273+
274+ it do
275+ is_expected . not_to contain_service ( title ) . with_subscribes_to (
276+ "File[/etc/systemd/system/#{ title } ]"
277+ )
278+ end
279+ end
270280 end
271281 end
272282 end
You can’t perform that action at this time.
0 commit comments