On Fri, Oct 29, 2010 at 04:56:34AM -0700, Leonko wrote:
> Hello,
> Anybody now how make with puppet dependence on other service on
> another node?
> 
> like :  require => Service[dbnode:postgresql]
> I need ensure that the db is running on another node before start my
> appserver.

You can't do this directly.  Even if you were to use storeconfigs to get
at facts about other nodes, all that would tell you is that the database
service was running the last time puppet ran on that node.  Besides, the
important thing to know, even more important than whether the service is
running on the dbnode, is whether you can usefully connect to the
service from your appserver node.  Even if the service is running, other
things might prevent that.

I think the best approach would be to have a test that runs on your
appservernode, connects to your postgres server and does a simple status
check.  You could do this as a custom fact, so that it set a variable
like $dbservice to true or false, or you could do it as an exec.

But can your application server really not cope with the database
service not being available?  Can they not present a useful error
message if the database is broken?  How will you cope if the database
service dies once your appserver has started?

-- 
Bruce

If the universe were simple enough to be understood, we would be too
simple to understand it.

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

Reply via email to