Hi chakkerz, First of all thanks for putting the effort in this.
secondly, I'm not sure, but what is the difference between what you just implemented with normal schedule meta parameter? schedule allows you to decide how often a certain resource would be checked/applied, and if I understood your code below, this is what you have implemented. again, if I didn't miss anything in your implementation, you still have a minimum of time (e.g. by default up to 30 minutes) that it takes to rollout a change, and when we are talking about critical changes this is not an option. I think I'll enhanced my mini puppet listener script and post it if anyone would be interested... Cheers, Ohad On Wed, Apr 8, 2009 at 6:55 AM, chakkerz <[email protected]> wrote: > > Hello again Ohad > > I've finally found some time to play with this. > > I'll give you the back of the proof of concept version and i'll write > some doco for the site when i get a chance. > > I've done two facts which are probably written in the worst way > possible, but i haven't done this before :) > > [r...@tangelo facter]# pwd > /etc/puppet/modules/custom/plugins/facter > [r...@tangelo facter]# cat system_time_* > # system_time_hour.rb > > Facter.add("system_time_hour") do > time = Time.now > hour = time.hour > setcode do > hour > end > end > > # system_time_minute.rb > > Facter.add("system_time_minute") do > time = Time.now > minute = time.min > setcode do > minute > end > end > > Then my default node class works out what OS, and based on that calls > the class for that OS, either OS class inherits from shared-default > which contains the non OS specific files and that shared one contains > an inheritance (the include was not smiling on me that day) to some > default variables. > > My default variables file defines: > class initialisevariables > { > ## > ## daily denotes an hour while hourly denotes a minute > ## > $solaris_daily = "7" > $solaris_hourly = "30" > > $linux_daily = "8" > $linux_hourly = "00" > } > > which the OS specific class uses to set itself up (this is for Linux): > $change_daily = $linux_daily > $change_hourly = $linux_hourly > > So so far so good :) > > Now the only module i've tested this on is my resolv_conf one which I > added at the start: > class resolv > { > $resolv_conf_urgency = "hourly" > case $resolv_conf_urgency > { > "minutely" : { $process_now = "true" } > "hourly" : { if ($system_time_minute == $change_hourly) > { $process_now = "true" }} > "daily" : { if ($system_time_hour == $change_daily ) > { $process_now = "true" }} > } > > if (($skip_resolv != "true") and ($process_now == "true")) > { > .... > > I'm not fully happy with this as yet, but in principle it works. > > > As to your query regarding me not having a current way to push things > out immediately... no i don't. IF we need to do something like this we > modify our cfengine instance and then hook onto each box that needs > the change urgently and run it by hand. Puppet will hopefully change > things ... especially with this notion i'm putting in place :) > > Cheers > chakkerz > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
