Issue #19718 has been updated by Lee Lowder.

Status changed from Investigating to Closed

This is not a puppet bug.

In the referenced module, file `cyclicbug/manifests/init.pp` starting at with 
line 38,

        file {"/apache/tomcat/webapps":
            ensure      => directory,
            recurse     => true,
            mode        => "ug+rw",
            require     => Archive["apache-tomcat-6.036"],
        }

The require here is what is causing the loop.

(note, first/next etc is used as the relative ordering for these resources due 
to explicit and implicit relationships, not necessarily an exact sequence of 
when they are applied in terms of all the resources that are to be applied.)

We have Archive['apache-tomcat-6.036'] which goes first. 
Next we have File['/apache/tomcat']. This is next because of an explicit 
require (notify in the original example)
Due to autorequire we next have: File['/apache/tomcat/webapps']

However, File['/apache/tomcat/webapps'] has an explicit require on 
File['/apache/tomcat/webapps'] which creates the loop.

Removing the require param will fix the cycle problem with the provided 
manifest.

The bug here is in the Archive module, not in Puppet.

A note on autorequire:
Whenever two directories are managed and one is a direct parent of the other, 
there is an implicit relationship that is created. This is documented at 
http://docs.puppetlabs.com/learning/ordering.html#autorequire

I have created https://projects.puppetlabs.com/issues/21747 to request expanded 
documentation that is located in a more logical area (as part of the actual 
language guide)



----------------------------------------
Bug #19718: Puppet seems to create backwards dependency resulting in cyclic 
dependencies
https://projects.puppetlabs.com/issues/19718#change-94667

* Author: Mike Power
* Status: Closed
* Priority: Urgent
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 3.1.1
* Keywords: dependency
cycle
* Branch: 
----------------------------------------
I have used someone's archive plugin to
1) download apache
2) ensure that webapps is present
3) download jenkins into webapps


naturally jenkins depends on webapps
webapps is made to depend on apache
apache depends are created by the archive plugin
archive plugin makes apache depend on the curl package.

That all makes sense.  However puppet picks up a really odd dependency that 
says package curl depends on jenkins.  I can't find where in the archive plugin 
this might be done.  It does not look like I did it.  So it seems like puppet.  
Let me know if I am wrong.

I created a sample project at:
https://github.com/dodtsair/puppet-cyclicdependency

It is a bit dodgy.  On my proprietary project if I add a package { "curl":} 
right next to the archive::download call.  Just sitting next to each other.  
The cycle goes away.  


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to