On Fri, Dec 17, 2010 at 02:26, CraftyTech <[email protected]> wrote:
> I'm not sure what I'm missing here, but when defining a file
> resource, to use as my yum repo, I can't seem to be able to purge
> other files in the directory.
When you specify recurse and purge to a file resource you need to do
that on a *directory*, not a file within the directory. So, in your
case you would need to give "/etc/yum.repos.d" as:
file { "/etc/yum.repos.d": ensure => directory, recurse => true,
purge => true, source => ... }
Then you have two choices:
First, you can point the source for that statement to a puppet:// URL
that is a directory containing, for example, the 'base.repo' file that
you want installed, and nothing else. Puppet will then ensure that is
all that ends up in that directory.
Second, you can point it to an empty directory, then have extra,
separate file statements like the one you did in your question -
without the recurse and purge options - that define the individual
files.
Finally, you can actually combine both of those: if you explicitly
manage a file it will override the "default" that the recurse/purge
combination create, so you can have a base directory copied in place
and everything except what puppet manages automatically removed.
Regards,
Daniel
--
✣ Daniel Pittman ✉ [email protected] ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
--
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.