----- Bruce Richardson <itsbr...@workshy.org> wrote:
> On Mon, Nov 28, 2011 at 02:22:51PM +0000, Dan White wrote:
> > As far as I can tell, the "replace" parameter is all or nothing.
> > 
> > What I am looking for is something like the exec/onlyif parameter that I 
> > can use to conditionally replace a file.
> > 
> > Any thoughts ?
> 
> There is more than one way to do this.  What kind of conditions woud you
> be testing for?
> 
> -- 
> Bruce
> 
> A problem shared brings the consolation that someone else is now
> feeling as miserable as you.

Thanks for responding.  Nice tag line.

OK, more details:

In my users class, I want to be able to push out custom dot-files when the user 
account is first created.
Unfortunately, if one sets user:managehome => true, the dotfiles are created by 
default and the custom file is not pushed out unless you set file:replace => 
yes.

The downside of this is that the dot-files would then have to be managed from 
the puppet-master, which, in this case, I would prefer to avoid.  I want to 
push the custom dot-files out the first time only.

My though was to place a flag line in the file to search for ("Created by 
Puppet") and then replace the file if I do not find my flag line.

Does that clarify ?

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to