On Fri, May 31, 2013 at 1:00 AM, Matthias Saou <[email protected]> wrote:

> There are other ways. None are nice and clean, but a custom fact just
> for this seems overkill.
>
> Here's a quick example of how I've implemented creating a default
> ~/.gitconfig for users if it doesn't exist, but not modify it if it's
> already there or has been modified.
>
>     $gitconfig_user_name = $mymodule::uservar::fullname[$title]
>     $gitconfig_user_email = "${title}@example.com"
>     file { "${home}/.gitconfig":
>       owner   => $owner,
>       group   => $group,
>       mode    => '0644',
>       require => Exec["create-gitconfig-${title}"],
>     }
>     exec { "create-gitconfig-${title}":
>       command => template('mymodule/user/gitconfig.erb'),
>       require => User[$title],
>       creates => "${home}/.gitconfig",
>     }
>

A bit off topic, but you should use file attribute replace => false instead
of an exec.

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to