Hi, I''m having trouble writing a recipe to handle apache/passenger. First, here is my apache2 class, found here : http://www.reductivelabs.com/trac/puppet/wiki/Recipes/DebianApache2Recipe --------------------------------------------- $apache2_sites = "/etc/apache2/sites" $apache2_mods = "/etc/apache2/mods" class apache2 { [...] define module ( $ensure = ''present'' ) { case $ensure { ''present'' : { exec { "/usr/sbin/a2enmod $name": unless => "/bin/readlink ${apache2_mods}-enabled/${name}.load", notify => Exec["force-reload-apache2"] } } ''absent'': { exec { "/usr/sbin/a2dismod $name": onlyif => "/bin/readlink ${apache2_mods}-enabled/${name}.load", notify => Exec["force-reload-apache2"] } } default: { err ( "Unknown ensure value: ''$ensure''" ) } } } [...] } --------------------------------------------- And then, my passenger class : --------------------------------------------- define passenger::install($version) { package { [ "build-essential", "apache2-prefork-dev", "libapr1-dev", "libaprutil1-dev" ]: ensure => installed } package { passenger: ensure => $version, provider => gem, require => [Class[''gems''], Class[''ruby''], Class[''apache2'']] } exec { passenger-install: command => "/usr/bin/yes \"\" | /usr/bin/passenger-install-apache2-module", creates => "/usr/lib/ruby/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so", require => Package[''passenger''] } } define passenger::enable($version) { passenger::install { passenger: version => $version } file { passenger-load: path => "/etc/apache2/mods-available/passenger.load", content => "LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so\n", mode => 644, require => Exec[''passenger-install''], } file { passenger-conf: path => "/etc/apache2/mods-available/passenger.conf", content => template("passenger/passenger.conf.erb"), mode => 644, require => Exec[''passenger-install''], } apache2::module { passenger: ensure => present, require => [File[''passenger-conf''], File[''passenger-load'']] } } --------------------------------------------- When my client node runs that, I get the following error : Could not apply complete catalog: Found dependency cycles in the following relationships: Exec[/usr/sbin/a2enmod passenger] => Exec[force-reload-apache2], Package[passenger] => Exec[passenger-install], Exec[passenger-install] => File[passenger-conf], File[passenger-conf] => Exec[/usr/sbin/a2enmod passenger], File[passenger-load] => Exec[/usr/sbin/a2enmod passenger], Exec[passenger-install] => File[passenger-load], Exec[force-reload-apache2] => Package[passenger] I''m sure I am missing something here, but it''s been a few hours now. So, I''d be very grateful if someone could point me in the right direction... Thanks, -- 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.
Hi, I''m having trouble writing a recipe to handle apache/passenger. First, here is my apache2 class, found here : http://www.reductivelabs.com/trac/puppet/wiki/Recipes/DebianApache2Recipe --------------------------------------------- $apache2_sites = "/etc/apache2/sites" $apache2_mods = "/etc/apache2/mods" class apache2 { [...] define module ( $ensure = ''present'' ) { case $ensure { ''present'' : { exec { "/usr/sbin/a2enmod $name": unless => "/bin/readlink ${apache2_mods}-enabled/${name}.load", notify => Exec["force-reload-apache2"] } } ''absent'': { exec { "/usr/sbin/a2dismod $name": onlyif => "/bin/readlink ${apache2_mods}-enabled/${name}.load", notify => Exec["force-reload-apache2"] } } default: { err ( "Unknown ensure value: ''$ensure''" ) } } } [...] } --------------------------------------------- And then, my passenger class : --------------------------------------------- define passenger::install($version) { package { [ "build-essential", "apache2-prefork-dev", "libapr1-dev", "libaprutil1-dev" ]: ensure => installed } package { passenger: ensure => $version, provider => gem, require => [Class[''gems''], Class[''ruby''], Class[''apache2'']] } exec { passenger-install: command => "/usr/bin/yes \"\" | /usr/bin/passenger-install-apache2-module", creates => "/usr/lib/ruby/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so", require => Package[''passenger''] } } define passenger::enable($version) { passenger::install { passenger: version => $version } file { passenger-load: path => "/etc/apache2/mods-available/passenger.load", content => "LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-$version/ext/apache2/mod_passenger.so\n", mode => 644, require => Exec[''passenger-install''], } file { passenger-conf: path => "/etc/apache2/mods-available/passenger.conf", content => template("passenger/passenger.conf.erb"), mode => 644, require => Exec[''passenger-install''], } apache2::module { passenger: ensure => present, require => [File[''passenger-conf''], File[''passenger-load'']] } } --------------------------------------------- When my client node runs that, I get the following error : Could not apply complete catalog: Found dependency cycles in the following relationships: Exec[/usr/sbin/a2enmod passenger] => Exec[force-reload-apache2], Package[passenger] => Exec[passenger-install], Exec[passenger-install] => File[passenger-conf], File[passenger-conf] => Exec[/usr/sbin/a2enmod passenger], File[passenger-load] => Exec[/usr/sbin/a2enmod passenger], Exec[passenger-install] => File[passenger-load], Exec[force-reload-apache2] => Package[passenger] I''m sure I am missing something here, but it''s been a few hours now. So, I''d be very grateful if someone could point me in the right direction... Thanks, -- 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.
2010/3/5 Julien Cornuwel <cornuwel@gmail.com>> Hi, > > I''m having trouble writing a recipe to handle apache/passenger. > [...] > When my client node runs that, I get the following error : > > Could not apply complete catalog: Found dependency cycles in the following > relationships: Exec[/usr/sbin/a2enmod passenger] => > Exec[force-reload-apache2], Package[passenger] => Exec[passenger-install], > Exec[passenger-install] => File[passenger-conf], File[passenger-conf] => > Exec[/usr/sbin/a2enmod passenger], File[passenger-load] => > Exec[/usr/sbin/a2enmod passenger], Exec[passenger-install] => > File[passenger-load], Exec[force-reload-apache2] => Package[passenger] >Found it ! The error was here : package { passenger: ensure => $version, provider => gem, require => [Class[''gems''], Class[''ruby''], Class[''apache2'']] } The passenger package should require the apache2 package. Not the whole class... -- 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.
On Fri, Mar 5, 2010 at 1:09 PM, Julien Cornuwel <cornuwel@gmail.com> wrote:>> Could not apply complete catalog: Found dependency cycles in the following >> relationships: Exec[/usr/sbin/a2enmod passenger] => >> Exec[force-reload-apache2], Package[passenger] => Exec[passenger-install], >> Exec[passenger-install] => File[passenger-conf], File[passenger-conf] => >> Exec[/usr/sbin/a2enmod passenger], File[passenger-load] => >> Exec[/usr/sbin/a2enmod passenger], Exec[passenger-install] => >> File[passenger-load], Exec[force-reload-apache2] => Package[passenger] > > Found it ! The error was here : > package { passenger: > ensure => $version, > provider => gem, > require => [Class[''gems''], Class[''ruby''], Class[''apache2'']] > }It can be quite hard to visualise dependency cycles - if you get Puppet to draw the resource graph, it''s much easier to see where the problem is: http://bitfieldconsulting.com/puppet-dependency-graphs J -- Bitfield Consulting: we make software that makes things work http://bitfieldconsulting.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.