Philip Zeyliger
2009-Mar-05 21:47 UTC
[Puppet Users] Visualizing puppet circular dependencies
I recently got a scary-looking circular dependency as a puppet error, and it took some thought to decipher it. Long story short, I fed it to graphviz, and the graph made it obvious where the problem was. Thought I''d share, in case others are having the same trouble. Code''s at http://gist.github.com/74566, and also pasted below for convenience. -- Philip # Make sense of puppet circular dependency error messages. # Tags: graphviz, puppet # See output at http://i41.tinypic.com/b6yeqv.jpg $ cat circular.pp node default { exec { "/a": require => Exec["/b"] } exec { "/b": require => Exec["/c"] } exec { "/c": require => Exec["/a"] } } $ puppet --color=false circular.pp \ | grep "the following relationships: " \ | awk -F"the following relationships: " ''{ print $2 }'' \ | tr , \\n \ | (echo "digraph {"; perl -pi -e''s/^\s*(\S.*\S) => (\S.*\S)\s*$/ "$1" -> "$2";\n/''; echo "}") \ | dot -Tpdf > circular.pdf --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frank Sweetser
2009-Mar-05 21:56 UTC
[Puppet Users] Re: Visualizing puppet circular dependencies
Philip Zeyliger wrote:> I recently got a scary-looking circular dependency as a puppet error, > and it took some thought to decipher it. > > Long story short, I fed it to graphviz, and the graph made it obvious > where the problem was. Thought I''d share, in case others are having > the same trouble. Code''s at http://gist.github.com/74566, and also > pasted below for convenience.This would look great added to the puppet wiki =) -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brice Figureau
2009-Mar-05 22:28 UTC
[Puppet Users] Re: Visualizing puppet circular dependencies
On 5/03/09 22:56, Frank Sweetser wrote:> Philip Zeyliger wrote: >> I recently got a scary-looking circular dependency as a puppet error, >> and it took some thought to decipher it. >> >> Long story short, I fed it to graphviz, and the graph made it obvious >> where the problem was. Thought I''d share, in case others are having >> the same trouble. Code''s at http://gist.github.com/74566, and also >> pasted below for convenience. > > This would look great added to the puppet wiki =)And I''d say the ext/ directory of the puppet distribution. -- Brice Figureau Days of Wonder http://www.daysofwonder.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---