3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'manifests/mapfile.pp', line 3
define autofs::mapfile ($path) {
include autofs
include autofs::params
# We need to check that the main concat has not already been
# declared or we'll get an error. We can use the same check
# to ensure that the base for the map file is only included
# once too.
if !defined(Concat[$path]) {
# The notify ensures that the service will be restarted
# when this map file is modified.
concat { $path:
owner => $autofs::params::owner,
group => $autofs::params::group,
mode => '0644',
notify => Service[$autofs::params::service],
}
# This fragment will be concatenated into the target file,
# which will be the file created above. It is included only
# once as a header to warn that the file is auto generated.
concat::fragment { "autofs::mapfile ${title}":
target => $path,
content => "# This file is automatically generated by Puppet\n#\n# Any changes made to this file will be lost on the next automated Puppet run!\n\n",
order => '100',
}
}
}
|