|
7 | 7 | #
|
8 | 8 | # [1] http://support.microsoft.com/kb/137890
|
9 | 9 | #
|
10 |
| -# @param ensure[ present, absent ] |
| 10 | +# @param ensure |
| 11 | +# Ensures the presence or absence of a registry key. Valid values: 'present', 'absent', 'UNSET'. |
| 12 | +# |
11 | 13 | # @param display_name
|
12 |
| -# The Display Name of the service. Defaults to the title of |
13 |
| -# the resource. |
| 14 | +# The Display Name of the service. Defaults to the title of the resource. |
| 15 | +# |
14 | 16 | # @param description
|
15 |
| -# A description of the service |
| 17 | +# A description of the service. String value set to 'UNSET' by default. |
| 18 | +# |
16 | 19 | # @param command
|
17 |
| -# The command to execute |
| 20 | +# The command to execute. Set to 'UNSET' by default. |
| 21 | +# |
18 | 22 | # @param start
|
19 | 23 | # The starting mode of the service. (Note, the native service
|
20 | 24 | # resource can also be used to manage this setting.)
|
21 |
| -# [ automatic, manual, disabled ] |
| 25 | +# Valid values: 'automatic', 'manual', 'disabled' |
22 | 26 | #
|
23 | 27 | #
|
24 | 28 | # Manages the values in the key HKLM\System\CurrentControlSet\Services\$name\
|
|
28 | 32 | # ensure => present,
|
29 | 33 | # display_name => 'Puppet Agent',
|
30 | 34 | # description => 'Periodically fetches and applies
|
31 |
| -# configurations from a Puppet Server.', |
| 35 | +# configurations from a Puppet Server.', |
32 | 36 | # command => 'C:\PuppetLabs\Puppet\service\daemon.bat',
|
33 | 37 | # }
|
34 | 38 | #
|
35 | 39 | define registry::service (
|
36 |
| - $ensure = 'UNSET', |
37 |
| - $display_name = 'UNSET', |
38 |
| - $description = 'UNSET', |
39 |
| - $command = 'UNSET', |
40 |
| - $start = 'UNSET' |
| 40 | + Enum['present', 'absent', 'UNSET'] $ensure = 'UNSET', |
| 41 | + String[1] $display_name = 'UNSET', |
| 42 | + String[1] $description = 'UNSET', |
| 43 | + String[1] $command = 'UNSET', |
| 44 | + Enum['automatic', 'manual', 'disabled', 'UNSET'] $start = 'UNSET' |
41 | 45 | ) {
|
42 | 46 | $ensure_real = $ensure ? {
|
43 | 47 | 'UNSET' => present,
|
44 |
| - undef => present, |
45 |
| - present => present, |
46 |
| - absent => absent, |
| 48 | + 'present' => present, |
| 49 | + 'absent' => absent, |
47 | 50 | }
|
48 | 51 |
|
49 | 52 | $display_name_real = $display_name ? {
|
|
64 | 67 |
|
65 | 68 | # Map descriptive names to flags.
|
66 | 69 | $start_real = $start ? {
|
67 |
| - automatic => 2, |
68 |
| - manual => 3, |
69 |
| - disabled => 4, |
| 70 | + 'automatic' => 2, |
| 71 | + 'manual' => 3, |
| 72 | + 'disabled' => 4, |
70 | 73 | }
|
71 | 74 |
|
72 | 75 | # Variable to hold the base key path.
|
|
0 commit comments