Am 24.05.2013 16:20, schrieb jcbollinger:

>>    Whenever I run this code on a client, the "directories" class gets
>>    executed first
> 
> As judged how?

Running "puppet apply --test" in a Client, destroying the client(it's a
Vagrant instance) and doing it again... ;)

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

How should I have diagnosed this? Would have the debug switch helped?

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

That did the trick. Now my code looks like this:

class database ( $serverpackage = 'mariadb' ) {
  class { 'database::packages':
    serverpackage => $serverpackage,
  }
  # setup data dirs(should change my.cnf and restart mysql!)
  class { 'database::directories':
    require => Class['database::packages'],
  }

  anchor {'db_first':} -> Class['database::packages'] -> anchor {'db_last':}

  [...]
}

After a handful of testruns it seems to work. I had read the
documentation you mentioned and didn't make the connection. My mistake.

Thanks for your help John.

BTW: I joined the related bug report ;)

Cheers, Shorty


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