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 :-) Simon. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
just a thought; what if you made a fact for number of apache workers currently serving something, and base the service restart off of that. Might not be the best option; might not even work, but it makes more sense to me to have the service restart dependent on a local fact than be dependent on something external to the server On Jan 6, 2012, at 3:52 PM, simonmcc 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 :-) > > Simon. > > -- > 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+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.________________________________ This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/about-us-legal-email-disclaimer.htm for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Simon McCartney
2012-Jan-12 13:16 UTC
Re: [Puppet Users] Re: Blocking or gating service restarts?
> > 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 C&C 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 C&C 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: simon@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Simon McCartney
2012-Jan-12 13:18 UTC
Re: [Puppet Users] Blocking or gating service restarts?
On 10 January 2012 18:36, Wolf Noble <wnoble@datapipe.com> wrote:> just a thought; what if you made a fact for number of apache workers > currently serving something, and base the service restart off of that. > > Might not be the best option; might not even work, but it makes more sense > to me to have the service restart dependent on a local fact than be > dependent on something external to the serverInteresting, making the machines LB status (& apache worker count etc would be pretty straightforward, machines already know if they are IS/OOS) - how do I use the fact to influence the restart - still needs a hook in the service resource type right? -- Simon McCartney E: simon@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.