|
52 | 52 | # (optional) Specifies the command to execute to check that the container is healthy using the docker health check functionality.
|
53 | 53 | # Default: undef
|
54 | 54 | #
|
| 55 | +# [*health_check_interval*] |
| 56 | +# (optional) Specifies the interval that the health check command will execute in seconds. |
| 57 | +# Default: undef |
| 58 | +# |
55 | 59 | # [*restart_on_unhealthy*]
|
56 | 60 | # (optional) Checks the health status of Docker container and if it is unhealthy the service will be restarted.
|
57 | 61 | # The health_check_cmd parameter must be set to true to use this functionality.
|
|
121 | 125 | Optional[Boolean] $read_only = false,
|
122 | 126 | Optional[String] $health_check_cmd = undef,
|
123 | 127 | Optional[Boolean] $restart_on_unhealthy = false,
|
| 128 | + Optional[Integer] $health_check_interval = undef, |
124 | 129 | ) {
|
125 | 130 | include docker::params
|
126 | 131 | if ($socket_connect != []) {
|
|
193 | 198 | read_only => $read_only,
|
194 | 199 | health_check_cmd => $health_check_cmd,
|
195 | 200 | restart_on_unhealthy => $restart_on_unhealthy,
|
| 201 | + health_check_interval => $health_check_interval, |
196 | 202 | })
|
197 | 203 |
|
198 | 204 | $sanitised_title = regsubst($title, '[^0-9A-Za-z.\-_]', '-', 'G')
|
|
449 | 455 | path => ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/'],
|
450 | 456 | command => 'systemctl daemon-reload',
|
451 | 457 | refreshonly => true,
|
452 |
| - require => File[$initscript], |
453 |
| - subscribe => File[$initscript], |
| 458 | + require => [File[$initscript],File[$runscript]], |
| 459 | + subscribe => [File[$initscript],File[$runscript]] |
454 | 460 | }
|
455 | 461 | Exec["docker-${sanitised_title}-systemd-reload"] -> Service<| title == "${service_prefix}${sanitised_title}" |>
|
456 | 462 | }
|
457 | 463 |
|
458 | 464 | if $restart_service {
|
459 |
| - File[$initscript] ~> Service<| title == "${service_prefix}${sanitised_title}" |> |
| 465 | + [File[$initscript],File[$runscript]] ~> Service<| title == "${service_prefix}${sanitised_title}" |> |
460 | 466 | }
|
461 | 467 | else {
|
462 |
| - File[$initscript] -> Service<| title == "${service_prefix}${sanitised_title}" |> |
| 468 | + [File[$initscript],File[$runscript]] -> Service<| title == "${service_prefix}${sanitised_title}" |> |
463 | 469 | }
|
464 | 470 | }
|
465 | 471 | }
|
|
0 commit comments