-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello John,
Answers inline

On 31/10/2011 15:40, jcbollinger wrote:
> 
> Your setup is a bit strange in using arrow syntax within a class to 
> declare a dependency of that class itself, though I'm not sure that 
> shouldn't work.  Instead, the key problem may be capitalization: to 
> the best of my knowledge, when you reference a resource you must 
> capitalize the resource *type*, but not the resource name, thus I 
> think you should use
> 
> Nginx::Vhost["website.domain.tld"] -> Class['pkgrepo']
> 
About dependency of a class declared in the class itself, it bascially a
matter of modules/class organization:
- - Each module should be as much independent as possible. If they need
some other modules/classes, all requirement should be setted up in
"root" class.
For example, it's a simple module but still relevant: pkgrepo
Its goal is to set up a debian package repository. For that, it'll
install all relevant package and configure everything it can.
But, it need nginx::vhost to set up directory tree so that it'll be able
to deploy GPG key.
To make code maintenance easier, I've choosen to put all dependancies in
"root" class (in my example pkgrepo and not pkgrepo::install or
pkgrepo::configure)

The example here is quite simple, but I'm working on other modules like
zabbix, which needs specific MySQL database/user.

About capitalization, it's basically an error from me :-/

> Nevertheless, it shouldn't just fail silently.  If you see nothing 
> relevant in either the master or the client's log about the 
> relationship not being honored, the resource not being found, or a 
> dependency cycle being detected, then you should file a ticket about 
> that.
> 
> Meanwhile, there are a couple of alternative, more conventional ways 
> to define your relationship.  For example, you might find this to
> work more reliably:
> 
> node nodetest { include nginx # NOTE relocation: include pkgrepo
> 
> nginx::vhost { 'website.domain.tld': port     => 80, docroot  =>
> '/var/www', priority => 00, # NOTE: require => Class['pkgrepo'] } 
> pkgrepo::repository { "test": docroot     =>
> "/var/www/website.domain.tld", gpgkeyid    => "C78033BD", } }

This example should work, but won't for more complicated modules
(example above with zabbix module I'm working on)

Regards,
JB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6u654ACgkQM2eZoKJfKd22yQCdFFNg2uqgBohKOOCFZmrfSuum
vdwAnAxETA97w/g7A3cZjJMpaeKcAEFR
=DI+f
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to