On Sunday, April 27, 2014, Lito K <[email protected]> wrote: > Hi everyone, > I have the following scenario: > I have an app.war file that needs to be expanded in tomcat, this war file > creates a new directory at /app/{data,config,profile}. > I need to change a file in /app/config/server.properties after the war > expansion. > I need to restart tomcat to refresh the config update. > > I tried this sequence: > copy app.war in webapps > run tomcat, the war expanded > change config > refresh tomcat > > In puppet, it becomes: > > file {"/tmp/app.war": > ensure => "present", > path => "/tomcat/webapps/app.war", > owner => "tomcat", > group => "tomcat", > before => Service["tomcat"], > } > > service { "tomcat": > ensure => "running", > enable => true, > subscribe => File["/app/config/server.properties"], > } > > file {"/app/config/server.properties": > ensure => "present", > source => "/tmp/newconfig/server.properties", > owner => "tomcat", > group => "tomcat", > notify => Service["tomcat"], > } > > You'll want either the subscribe or notify relationship between the service and file, but not both as that creates a dependency cycle.
I keep getting this error: > > *err: Could not apply complete catalog: Found 1 dependency cycle:* > > *(File[/app/config/server.properties] => Service[tomcat] => > File[/app/config/server.properties])* > > *Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.* > I was wondering if someone can give me a hint how to solve this dependency > cycle issue. > > My understanding: > Tomcat subscribes to config file (meaning it will be refreshed if there's > a change in the config file) > The config file change, then it notifies tomcat. > Tomcat picks up the notification, it then refreshes. > I don't see where the cycle happens??? > > I am fairly new to puppet, so any explanation would help. > > Many thanks. > > Puppet client: 2.7.25-2 (from EPEL, latest for CENTOS 6) > OS: Redhat 6.4 64bit > > > -- > 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]<javascript:_e(%7B%7D,'cvml','puppet-users%[email protected]');> > . > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/65db7123-65ab-4350-b862-f68ebd7f4d0a%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/65db7123-65ab-4350-b862-f68ebd7f4d0a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > Josh -- Josh Cooper Developer, Puppet Labs *Join us at PuppetConf 2014 <http://www.puppetconf.com/>, September 22-24 in San Francisco* *Register by May 30th to take advantage of the Early Adopter discount <http://links.puppetlabs.com/puppetconf-early-adopter> **—**save $349!* -- 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/CA%2Bu97u%3DaeX2_%2BJmuqpgb1CyWfd_GL1qd-RyEDy78dCO5fBfSDQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
