File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 64
64
# @param daemon_reload
65
65
# call `systemd::daemon-reload` to ensure that the modified unit file is loaded
66
66
#
67
+ # @param notify_service
68
+ # Notify service if systemd file is changed
69
+ #
67
70
# @example manage unit file + service
68
71
# systemd::unit_file { 'foo.service':
69
72
# content => file("${module_name}/foo.service"),
88
91
Optional[Boolean] $hasstatus = undef ,
89
92
Boolean $selinux_ignore_defaults = false ,
90
93
Hash[String[1], Any] $service_parameters = {},
91
- Boolean $daemon_reload = true
94
+ Boolean $daemon_reload = true ,
95
+ Boolean $notify_service = true ,
92
96
) {
93
97
include systemd
94
98
152
156
}
153
157
Service[$name ] -> File [" ${path} /${name} " ]
154
158
} else {
155
- File [" ${path} /${name} " ] ~> Service[$name ]
159
+ if $notify_service {
160
+ File [" ${path} /${name} " ] ~> Service[$name ]
161
+ }
156
162
157
163
if $daemon_reload {
158
164
Systemd::Daemon_reload[$name ] ~> Service[$name ]
Original file line number Diff line number Diff line change 267
267
expect ( subject ) . not_to create_systemd__daemon_reload ( title )
268
268
}
269
269
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
270
280
end
271
281
end
272
282
end
You can’t perform that action at this time.
0 commit comments