On 28.11.2011, at 19:18, Stefan Schulte wrote:
>> [...]
>> Thanks for responding.
>> I agree, globally customizing the defaults is one way to go, but I am
>> shooting for the second option.
>>
>
> If you do not want the gobal defaults copied why are you using
> managehome => true?
>
> If you really have to go this awkward path you can create a conditional
> exec resoure that removes the dotfiles if they are equal to the skel files
> so puppet will copy the correct files again. (fileresources with replace
> => false)
>
> A second solution is to create a custom fact that tells you if puppet
> should manage the dotfiles and wrap your fileresources in an if-clause
> (fileresources with replace => true)
>
> -Stefan
We have another usecase for conditional file replacement:
if a developer would like to forbid any puppet changes on a certain file he
creates a flagfile $name.nopuppet
instead of normal file resource we use a parameterized define:
define configfile ($source) {
exec { "check_${name}":
command => '/usr/bin/true',
unless => "/usr/bin/test -e ${name}.nopuppet",
}
file { "$name":
source => $source,
requires => Exec["check_${name}"],
}
}
we then use this define on certain files.
e.g.
configfile { "/etc/apache2/apache2.conf": source =>
"puppet:///modules/apache2/apache2.conf" }
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.