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

On Dec 31, 2013, at 4:05 PM, amogh patel <[email protected]> wrote:

> 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
> 
> -- 
> 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 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.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/375E18FF-AD0F-4E3C-AD9B-6CAB39A5784D%40aqwari.net.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to