On Friday, May 24, 2013 5:12:33 AM UTC-5, Markus Shorty Uckelmann wrote:
>
> Hi all, 
>
> I'm stuck in the hell of class dependencies and hope that someone here 
> can help me. 
>
> Puppet-Version is 2.7.21 
> It's the Debian Squeeze package from the Puppetlabs Repo. 
>
> I want one class to manage everything database related. So I call it in 
> "site.pp" like this: 
>
>   node client1 { 
>     class { 'database': } 
>   } 
>
> It's parameterized and uses default values. The class "database" 
> declares(executes) other classes. 
>
> Now to my problem. I have a "sub"-class "database::packages" which must 
> be executed before every other stuff inside the database class. Here is 
> the code: 
>
> 1 class database { 
> 2   class { 'database::packages': } -> 
> 3   # setup data dirs 
> 4   class { 'database::directories': 
> 5     # require => Class['database::packages'], 
> 6   } 
> 7   # Class['database::packages'] -> Class['database::directories'] 
> 8 } 
>
> I tried three different things. None of them worked. First one is the 
> chaining arrow in line 2. The next two tries I left commented out. In 
> line 5 I tried to require the "packages" class inside the "directories" 
> class declaration. And last in line 7 I tried the chaining again. 
>
> Whenever I run this code on a client, the "directories" class gets 
> executed first



As judged how?

 

> and fails, because it needs a specific user which is 
> setup in the "packages" class. 
>
>
 
All of the methods you tried for declaring the needed relationship are 
valid and appear correct.  I conclude that you have diagnosed the problem 
incorrectly.

To be sure, you do have an order-of-application issue, but I don't think 
it's the relative order of these classes themselves that is the problem.  
It is more likely a containment issue within one or more of those classes' 
implementations.  I suggest you read the documentation on that area 
(http://docs.puppetlabs.com/puppet/3/reference/lang_containment.html) for 
information on that problem and and least one possible solution.


John

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to