Chef/puppet are great tools for managing the configuration of individual hosts, but they seem to fall down slightly when a configuration has dependencies between hosts. For example, I'd like to have a web server configuration that tries to start an application, but only if the database has already been started (on another host). Is there some similar tool that allows configurations to be specified which span hosts, or are there some extra bits of chef or puppet that make this possible?
One thing you could do would be export the application resource from the database host. It would not guarantee the database is running, but, then again, nothing will. After all, the database may be stopped afterwards, and Puppet wouldn't know a thing about it until the next time it runs.
It would look something like this, anyway:
If you combine this with Davey's suggestion, you could further tie starting the application to a test of the database:
I think you could write a custom fact for puppet/facter to do that. Here is an explanation from the puppetlabs website:
Basically, if you can write the test in ruby then you can create a fact and deploy it to your puppet clients.