On 3/4/15 9:57 AM, Steve Harp wrote: > Hi Guys, > > I'm using Puppet for many configuration items and package deployments. > I need to be able to only deploy certain packages/classes when the > Agent sends a definable command line option. > > Example: puppet agent --onetime --no-daemonize --verbose > --do_something_special > > I want to be able to execute a class only when the > '--do_something_special' flag is passed. > > Is this possible? > > Thanks for any suggestions..... >
Hi, It is possible and pretty straight forward if you use a master-less setup. In that case you run `puppet apply -v some_manifest.pp`. >From what you are describing it seems that you want to use Puppet as a method for invoking scripts in an ad-hoc fashion, which is not at all what Puppet is really built to do. With a configuration management tool, you want to build a model (aka desired system state) and then apply that model to your systems. If your goal is to simply install different packages, first figure out what your criteria is. Is it based on the role of the system, the OS, its location, ... ? With that information, you could add the appropriate levels to Hiera's[1] lookup hierarchy and do your modeling there. Here's a module[2] that would let you do that. [1] - https://docs.puppetlabs.com/hiera/1/complete_example.html [2] - https://forge.puppetlabs.com/ghoneycutt/types#package Best regards, -g -- Garrett Honeycutt @learnpuppet Puppet Training with LearnPuppet.com Mobile: +1.206.414.8658 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/54F74003.3030203%40garretthoneycutt.com. For more options, visit https://groups.google.com/d/optout.
