I would like to have packages installed either in the early morning or whenever I manually choose to do so on a particular machine. I am trying to convert my existing configuration from cfengine so in that tool I had something like: packages: Hr03|ManualRun:: <package installation commands> This basically says to install packages if it''s either 3:00-3:59am or if the ManualRun class is defined. This achieved my goal as either the packages were installed around 3am or they were installed when I manually chose to do so by specifying "-DManualRun" on the command line when calling the cfengine client. Is there a way to do something similar in puppet? I have found that I can use either: package { "packagename": ensure => latest, schedule => "daily" } (where "daily" is defined as between 2-4am) OR package { "packagename": ensure => latest, tag => "manualrun" } These each do what I want them to do, but if I try to combine them: package { "packagename": ensure => latest, schedule => "daily", tag => "manualrun" } the package installation doesn''t get done if I call "puppetd --tag manualrun" because the schedule is not satisfied. Any ideas? Thanks, Jeremy Dreese
Jeremy Dreese wrote:> These each do what I want them to do, but if I try to combine them: > > package { "packagename": ensure => latest, schedule => "daily", tag => > "manualrun" } > > the package installation doesn''t get done if I call "puppetd --tag > manualrun" because the schedule is not satisfied. Any ideas?I''ve run into this too, and I don''t think there''s a direct solution, though you could exploit the singleton nature of classes: class pkg-update { package { "packagename": ensure => latest } } define pkg-installer { include package-installation } node mynode { pkg-installer{"scheduled": schedule => "daily" } pkg-installer{"tagged": tag => "manualrun" } } In this manifest, node mynode will configure class pkg-update if the schedule matches or manualrun is specified as a tag. If both are true, the class pkg-update is still only configured once. It''s sort of a hack (or maybe not, it actually seems pretty clean), but it works since a class will only ever be configured once, no matter how many times it''s included. Cheers, -- Jeff McCune The Ohio State University Department of Mathematics Systems Manager _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Jeff McCune wrote:> class pkg-update { package { "packagename": ensure => latest } } > > define pkg-installer { include package-installation }Whoops, that should be: define pkg-installer { include pkg-update } -- Jeff McCune The Ohio State University Department of Mathematics Systems Manager _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On May 18, 2007, at 8:59 AM, Jeremy Dreese wrote:> > I would like to have packages installed either in the early morning or > whenever I manually choose to do so on a particular machine. I am > trying to convert my existing configuration from cfengine so in that > tool I had something like: > > packages: > Hr03|ManualRun:: > <package installation commands> > > This basically says to install packages if it''s either 3:00-3:59am > or if > the ManualRun class is defined. This achieved my goal as either the > packages were installed around 3am or they were installed when I > manually chose to do so by specifying "-DManualRun" on the command > line > when calling the cfengine client. > > Is there a way to do something similar in puppet? I have found that I > can use either: > [...] > the package installation doesn''t get done if I call "puppetd --tag > manualrun" because the schedule is not satisfied. Any ideas?There''s an --ignoreschedules option you can use to, um, ignore schedules. As long as there aren''t other schedules you''re hoping to stick with, this should work for you. If you do want to ignore a specific schedule, then combine that option with --tags to narrow down what you''re executing. -- I respect faith, but doubt is what gets you an education. -- Wilson Mizner --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
> There''s an --ignoreschedules option you can use to, um, ignore > schedules.Okay... well, that was way too easy. Sorry I didn''t catch that option. On a related note, I noticed that when I run "puppetd --help" I don''t see an --ignoreschedules option; I do, however, see it when running "puppetrun --help". Shouldn''t the --ignoreschedules option also be included in the puppetd help page? I completely understand if the answer is "I/we haven''t had time to document everything yet". I just want to make sure I''m not missing something in my understanding of puppet. Thanks for the help! Jeremy
On May 18, 2007, at 9:49 AM, Jeremy Dreese wrote:> Okay... well, that was way too easy. Sorry I didn''t catch that option. > > On a related note, I noticed that when I run "puppetd --help" I don''t > see an --ignoreschedules option; I do, however, see it when running > "puppetrun --help". Shouldn''t the --ignoreschedules option also be > included in the puppetd help page? I completely understand if the > answer > is "I/we haven''t had time to document everything yet". I just want to > make sure I''m not missing something in my understanding of puppet.There''s an unfortunate split in options -- most options are documented in the configuration reference[1], but some are per- interpreter and thus documented there. I haven''t found a good way to fix that. 1 - https://reductivelabs.com/trac/puppet/wiki/ConfigurationReference -- I believe that if it were left to artists to choose their own labels, most would choose none. -- Ben Shahn --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com