Andreas Dvorak
2013-Oct-21 07:37 UTC
[Puppet Users] Resource file copy files recurse in existing directory with existing files
Hi, I have a file resource that brings files in the diretory "/usr/local/nagios/libexec" from source1 and I have a second resource file that should bring file in that same directory but from an other source. But the result is that only the files from file { "/usr/local/nagios/libexec": do exit in the directory. I tried remote and true. The resource file { "/usr/local/nagios/libexec": deletes all the files in the directory "/usr/local/nagios/libexec" that came with file { "/usr/local/nagios": Can somebody please help me? file { "/usr/local/nagios": ensure => directory, owner => "nagios", group => "nagios", mode => 755, source => "$source", recurse => true, require => User [''nagios''], schedule => "nagios_client-schedule", } file { "/usr/local/nagios/libexec": ensure => directory, owner => "nagios", group => "nagios", mode => 755, source => "puppet:///extra_files/basisapplikationen/monitoring/nagios/client/custom-plugins", recurse => remote, require => File [''/usr/local/nagios''], schedule => "nagios_client-schedule", } Best regards Andreas -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Oct-21 13:37 UTC
[Puppet Users] Re: Resource file copy files recurse in existing directory with existing files
On Monday, October 21, 2013 2:37:10 AM UTC-5, Andreas Dvorak wrote:> > Hi, > > I have a file resource that brings files in the diretory > "/usr/local/nagios/libexec" from source1 and I have a second resource file > that should bring file in that same directory but from an other source. > But the result is that only the files from file { > "/usr/local/nagios/libexec": do exit in the directory. I tried remote and > true. The resource file { "/usr/local/nagios/libexec": deletes all the > files in the directory "/usr/local/nagios/libexec" that came with file { > "/usr/local/nagios": > Can somebody please help me? >That sounds like the behavior that would be expected with "purge => true". I didn''t think that was the default, but perhaps you have a resource default override in scope. If you want to purge unmanaged files, then it is sufficient to enable purging for only File[''/usr/local/nagios'']; enabling it also for File[''/usr/local/nagios/libexec''] (or any other subdirectory) will have the result you describe, because the latter resource is applied independently of the former. Overall, it is unwise to manage the same physical resource via more than one Puppet logical resources, which is what you are doing with directory /usr/local/nagios/libexec. If you can come up with an alternative approach to avoid that problem then you would be better off. 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Andreas Dvorak
2013-Oct-21 14:27 UTC
[Puppet Users] Re: Resource file copy files recurse in existing directory with existing files
Hi John, I add purge => false in the file /usr/local/nagios/libexec but it did not change anythink. I need to find out if I can put the files in an other directory. Thank you Andreas -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Andreas Dvorak
2013-Oct-22 08:50 UTC
[Puppet Users] Re: Resource file copy files recurse in existing directory with existing files
Dear all, now I have got the solution file { "/usr/local/nagios/libexec": ensure => present, owner => "nagios", group => "nagios", mode => 755, sourceselect => all, source => ["puppet:///extra_files/basisapplikationen/monitoring/nagios/client/custom-plugins","${source}/libexec"], recurse => true, require => File [''/usr/local/nagios''], schedule => "nagios_client-schedule", } Andreas -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.