|
1 | 1 | # == Define: docker::services |
2 | | -# |
3 | | -# A define that managers a Docker services |
| 2 | +# |
| 3 | +# A define that managers a Docker services |
4 | 4 | # |
5 | 5 | # == Paramaters |
6 | 6 | # |
7 | | -# [*ensure*] |
| 7 | +# [*ensure*] |
8 | 8 | # This ensures that the service is present or not. |
9 | 9 | # Defaults to present |
10 | 10 | # |
11 | | -# [*image*] |
12 | | -# The Docker image to spwan the service from. |
13 | | -# Defualts to undef |
| 11 | +# [*image*] |
| 12 | +# The Docker image to spwan the service from. |
| 13 | +# Defualts to undef |
14 | 14 | # |
15 | | -# [*detach*] |
| 15 | +# [*detach*] |
16 | 16 | # Exit immediately instead of waiting for the service to converge (default true) |
17 | 17 | # Defaults to true |
18 | 18 | # |
|
30 | 30 | # Defaults to undef |
31 | 31 | # |
32 | 32 | # [*replicas*] |
33 | | -# Number of tasks (containers per service) |
| 33 | +# Number of tasks (containers per service) |
34 | 34 | # defaults to undef |
35 | | -# |
| 35 | +# |
36 | 36 | # [*tty*] |
37 | 37 | # Allocate a pseudo-TTY |
38 | 38 | # Defaults to false |
|
51 | 51 | # defaults to [] |
52 | 52 | # |
53 | 53 | # [*update*] |
54 | | -# This changes the docker command to |
55 | | -# docker service update, you must pass a service name with this option |
| 54 | +# This changes the docker command to |
| 55 | +# docker service update, you must pass a service name with this option |
56 | 56 | # |
57 | 57 | # [*scale*] |
58 | 58 | # This changes the docker command to |
59 | | -# docker service scale, this can only be used with service name and |
| 59 | +# docker service scale, this can only be used with service name and |
60 | 60 | # replicas |
61 | | -# |
| 61 | +# |
62 | 62 | # [*host_socket*] |
63 | 63 | # This will allow the service to connect to the host linux socket. |
64 | 64 | # defaults to undef |
|
154 | 154 | workdir => $workdir, |
155 | 155 | extra_params => any2array($extra_params), |
156 | 156 | image => $image, |
| 157 | + host_socket => $host_socket, |
157 | 158 | }) |
158 | 159 |
|
159 | 160 | $exec_update = "${docker_command} update ${docker_service_flags}" |
|
173 | 174 | extra_params => any2array($extra_params), |
174 | 175 | }) |
175 | 176 |
|
176 | | - $exec_scale = "${docker_command} scale ${docker_service_flags}" |
| 177 | + $exec_scale = "${docker_command} scale ${service_name}=${replicas}" |
177 | 178 |
|
178 | 179 | exec { 'Docker service scale': |
179 | 180 | command => $exec_scale, |
|
191 | 192 | } |
192 | 193 | } |
193 | 194 | } |
| 195 | + |
0 commit comments