Re: [Puppet Users] Re: Blocking or gating service restarts?

2012-01-26 Thread Simon McCartney

 Generally, Puppet uses a service's init script to manipulate it, so
 you can alter services' restart behavior by modifying their init
 scripts.  That has the additional advantage that you get the same
 behavior if the service is ever restarted any other way.


good point, but now I have to repackge or overlay standard init scripts
(httpd  mysql at least, others are ours so less of an issue)


 There is no way to tell Puppet to start processing one resource,
 switch to processing a different resource, and later resume with the


I'd be happy enough for the puppet apply to just stall during bleed-down etc


 first.  You could possibly split the load balancer bleed-down and spin-
 up into separate resources, however, and use standard Puppet 'require'
 and 'before' relationships or resource chaining to establish order of
 application.  That might be advantageous if there are multiple
 resources you want to manage only while the load-balancer is down.


That sounds interesting, but how would you get the require/before to apply
to just a service restart as a result of the subscription?

eg if i have:

service { 'mysqld':
ensure = running,
enable = true,
subscribe = File['/etc/my.cnf'],
require = [ Package['mysql-server'], File['/prod/mysql'] ],
}

I'm want mysql to restart for any changes to /etc/my.cnf, but only when the
machine is OOS.

We have tools that coordinate restarts atm, but from the CC out, not boxes
asking of they can restart, I'm thinking along the lines of a hook in the
service resource type to call a user-defined script to check if it's ok to
restart, blocking the puppet run until it gets an answer, the user defined
script then does what ever comms required to see if CC are ok with the
OOS/restart.

(we do rolling deploys by allowing up to X% of machines in a given service
to go OOS for deployments)

Simon.

-- 
Simon McCartney
E: si...@mccartney.ie
M: +44 7710 836 915

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@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.



[Puppet Users] Re: Blocking or gating service restarts?

2012-01-09 Thread jcbollinger


On Jan 6, 3:52 pm, simonmcc simon.mccart...@gmail.com wrote:
 inside puppet is it possible to block or stall a service restart until
 some external component clears the restart?

 for example, I want to make sure a node is bled down on the load-
 balancer before allowing the restart to happen.

 a post restart feature of re-enabling in the load-balancer would also
 be really useful :-)


Generally, Puppet uses a service's init script to manipulate it, so
you can alter services' restart behavior by modifying their init
scripts.  That has the additional advantage that you get the same
behavior if the service is ever restarted any other way.

There is no way to tell Puppet to start processing one resource,
switch to processing a different resource, and later resume with the
first.  You could possibly split the load balancer bleed-down and spin-
up into separate resources, however, and use standard Puppet 'require'
and 'before' relationships or resource chaining to establish order of
application.  That might be advantageous if there are multiple
resources you want to manage only while the load-balancer is down.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@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.