Hello everyone.

I've been toying around with puppet and something happened that seems 
strange to me.
In site.pp I have the following: 

> node default {
>
>   # This is where you can declare classes for all nodes.
>
>   # Example:
>
>   #   class { 'my_class': }
>
>   #  class { 'lamp': }
>
>   package {'php':
>
>       ensure   => present,  
>
>       before => File['/etc/php.ini'],
>
>   }
>
>
>>   file {'/etc/php.ini':
>
>       ensure => file,
>
>   }
>
>
>>   package {'httpd':
>
>     ensure => present,
>
>   }
>
>
>>   service {'httpd':
>
>       ensure          => running,
>
>       enable        => true,
>
>       require     => Package['httpd'],
>
>       subscribe => File['/etc/php.ini'],
>
>   }
>
>
>>   package {'mysql-server':
>
>       ensure => 'present',
>
>   }
>
>
>>   service {'mysqld':
>
>       ensure      => running,
>
>       enable    => true,
>
>       require => Package['mysql-server'],
>
>   }
>
> }
>
>
> [I know about classes etc, this was just for easy testing. ]

Now, if I change the httpd resource to 

> package {'httpd':

      ensure => absent,

  }

 
I get the following error:

> Error: Execution of '/bin/rpm -e httpd-2.2.3-82.el5.centos.i386' returned 
>> 1: error: Failed dependencies:
>
> httpd-mmn = 20051115 is needed by (installed) php-5.1.6-40.el5_9.i386
>
>
>> Error: /Stage[main]//Node[default]/Package[httpd]/ensure: change from 
>> 2.2.3-82.el5.centos to absent failed: Execution of '/bin/rpm -e 
>> httpd-2.2.3-82.el5.centos.i386' returned 1: error: Failed dependencies:
>
> httpd-mmn = 20051115 is needed by (installed) php-5.1.6-40.el5_9.i386
>
>
>> Notice: /Stage[main]//Node[default]/Service[httpd]: Dependency 
>> Package[httpd] has failures: true
>
> Warning: /Stage[main]//Node[default]/Service[httpd]: Skipping because of 
>> failed dependencies
>
> Notice: Finished catalog run in 15.00 seconds
>
>
This seems strange to me, because I never declared a require dependency 
from php to httpd. 
The only thing is that the httpd  service subscribes to the php.ini file. I 
could understand this error if the direction of this dependency was the 
other way around, but not this way.

The reason for this testing was that I'm trying to found out how puppet 
handles dependencies when removing related resources.
Say that a php install requires a web server, and I delete the web server, 
will puppet also delete the php install if it has no other dependencies, 
etc..

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to