file management

15 views
Skip to first unread message

amogh patel

unread,
Dec 31, 2013, 4:05:39 PM12/31/13
to puppet...@googlegroups.com
Hi,

I need to manage some files in a directory. Lets say, /root/mydir can contain only file a,b & c and rest others should be discarded. How can I maintain it with Puppet code?

Thanks,
amogh

David Arroyo

unread,
Dec 31, 2013, 5:34:13 PM12/31/13
to puppet...@googlegroups.com
See the 'recurse' and 'purge' parameters of the file type.
http://docs.puppetlabs.com/references/latest/type.html#file

file{'/root/mydir':
ensure => directory,
recurse => true,
purge => true,
}

file{['/root/mydir/a','/root/mydir/b','/root/mydir/c']:
ensure => file,
}

-David
> --
> 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 puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/19dc488f-6b2e-469b-bc1e-cb4c9ec69c9f%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages