Robb
2008-Apr-18 22:09 UTC
[Puppet Users] File Resource with recurse and source attributes
I am running into an issue which would be helpful get feedback on:
I am using a file resource to recursively manage a directory from the
Puppetmaster fileserver. E.g.:
file { "application-code" :
path => "/var/lib/tomcat5/webapps/ROOT",
backup => false,
group => "tomcat",
purge => true,
recurse => true,
force => true,
source => "puppet:///application-code/builds/$version/code",
notify => Service["tomcat5"]
}
There are a couple of file changes I am making to the managed
directory AFTER (via the ''require'' attribute) the code is
copied:
file { "log4j.xml" :
path => "/var/lib/tomcat5/webapps/ROOT/WEB-INF/classes/
log4j.xml",
source => "puppet:///application-code/log4j.xml",
require => File["application-code"],
notify => Service["tomcat5"],
}
file { "index.html" :
path => "/var/lib/tomcat5/webapps/ROOT/index.html",
content => "",
require => File["application-code"],
}
The problem I am running into is Tomcat5 is restarted *twice*:
The first execution: the (a) File["application-code"] is copied, (b)
the time "checksum" for the directories "classes" and
"ROOT" root are
captured, and (c) File["log4j.xml"] and File["index.html"]
copied.
After all that, the Tomcat5 service is, appropriately, restarted.
The second execution: the time "checksums" on the directories
"classes" and "ROOT" have changed due to (c) and Tomcat5 is
refreshed.
Is there a way to 1) use recursion to manage a directory and 2) modify/
add files WITHOUT forcing the dependent service to restart twice?
Many thanks for your feedback and input,
Robb Wagoner
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---