On Thursday, January 21, 2016 at 4:03:24 AM UTC-6, paul zhao wrote:
>
> In Centos 6.5, I use puppet 3.8.2. I found an question, for example:
>
>  in pupept-server machine, there has diretory A,  and a.conf in A, b.conf 
> in A,
> then in puppet-agent, after synchronized(puppet agent -t), there also has 
> diretory A, a.conf in A, b.conf in A
> next, in pupept-server, I deleted ../A/b.conf,
> then in puppet-agent, after synchronized(puppet agent -t), there also has 
> diretory A, a.conf in A and b.conf in A, 
>
> Why in puppet-agent, ../A/b.conf still existed?
>


You did not present the relevant manifests with which you are managing 
these files, and much hinges on the details of those.

>From your description, I speculate that you are managing the whole thing 
via a single recursive File resource, something like this:

    file { '/some/parent/A':
      ensure  => 'directory',
      source  => 'puppet:///modules/mymodule/A',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      recurse => true
    }

With that particular declaration, Puppet will manage directory 
/some/parent/A, and it will additionally manage one File for each for each 
file in the directory tree rooted in directory A of the modules files 
directory.  That declaration will *not* cause any other files to be 
managed, but if you want to additionally ensure that the managed directory 
contains only managed files (whether managed via that File resource or 
another) then you can specify that by adding a 'purge' attribute:

      purge   => true,

This is covered by the type reference 
<http://docs.puppetlabs.com/references/latest/type.html#file>.


John

-- 
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/858138ff-007d-41a6-8151-85d21c8549b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to