Hi,

I have noticed a very strance problem with my current puppet setup on one of the nodes.

This is very peculiar problem indeed.


I have class php which looks like this:

# Class: php$major
#
# This module manages php$major installation for CentOS 5
#
class php (
  $major          = $php::params::major,
  $package_ensure = $php::params::package_ensure,
  $timezone       = $::timezone,
) inherits php::params {
  # packages from CentOS base
  package { 'php':
    ensure => $package_ensure,
    name   => "php${major}",
  }
  package { 'php-cli':
    ensure => $package_ensure,
    name   => "php${major}-cli",
  }
  package { 'php-common':
    ensure => $package_ensure,
    name   => "php${major}-common",
  }

  file { '/etc/php.d/timezone.ini':
    ensure  => file,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => template('php/timezone.ini.erb'),
    require => Package['php-common'],
  }
}


Now, I have many subclases for php modules, like this one:

# Class: php::mod::bcmath
class php::mod::bcmath (
  $major          = $php::major,
  $package_ensure = $php::package_ensure,
) inherits php {
  package { 'php-bcmath':
    ensure => $package_ensure,
    name   => "php${major}-bcmath",
  }
}

It's obvious that this class inherits class php.


Now, I have a following classes that include the php:

class system::templates::php {
  include ::php
  include ::php::mod::bcmath
}

But I also have a class system::php ,which only brings /etc/php.d/system.ini :

class system::php {
  file { '/etc/php.d/system.ini': }
}


Now, strange thing is, if system::php is present, puppet does automatic include on every node that has some of the php::mod::* included... But if I rm -f system/manifests/php.pp, not a single node reports an error...

So, it's obvious that system::php is being pulled in catalog somehow, I presume by the 'inherits php' code from php submodules. I have alot of other code around, so I didn't (yet) try to code up the minimal possible code that causes this behaviour... But sure as hell this is unintended in my case...

I was pretty cautious in specifying top scope in numeros occasions when including or requiring classes, but this time I thing that 'inherits' bit me...


Has anyone had similar problems? Should I change my classes code in some way to avoid this kind of issues in the future?



--
Jakov Sosic
www.srce.unizg.hr

--
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