Hi I am new to puppet. I have an existing puppet 2.6 config and I have about 400 hosts that I would like to install a package on. the specific package is foo_bar_1.0.rpm How would I deploy this to all hosts that talk to my puppetmaster? Thanks Chris -- 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 Fri, Jun 22, 2012 at 08:50:59AM -0700, Christian DeKonink wrote:> Hi� > I am new to puppet. I have an existing puppet 2.6 config and I have about > 400 hosts that I would like to install a package on. the specific package > is > foo_bar_1.0.rpmSave your sanity: set up a local yum repository (look into /usr/bin/createrepo) and configure both the repository software (web server, site config, directory structure) and the client yum config via puppet. Then you can use the package type to declare it on various hosts: http://docs.puppetlabs.com/references/stable/type.html#package Example: class myrpm { package { ''foo_bar'': } } node "myhost.me.com" { class { ''myrpm'': } } If this is something that you absolutely must do by the end of the day on a Friday because some manager is a maniac, you can deploy the rpm via a file resource and then install it by specifying alternate package type parameters: class myrpm { $myrpm = ''/tmp/foo_bar_1.0.rpm'' $myrpmsource = "puppet:///modules/myrpm/foo_bar_1.0.rpm" $mypkg = "foo_bar" file { $myrpm: source => $myrpmsource, } package { $mypkg: provider => ''rpm'', source => $myrpm, require => File[$myrpm], } } node "myhost.me.com" { class { ''myrpm'': } } With the above I am assuming that your classes are in modules (save your sanity, use them). More on modules: http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html http://docs.puppetlabs.com/module_cheat_sheet.html Also remember dependencies: http://docs.puppetlabs.com/references/stable/metaparameter.html#require And more generally: http://docs.puppetlabs.com/guides/language_guide.html> How would I deploy this to all hosts that talk to my puppetmaster? > Thanks > Chris > > -- > 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.-- 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 22.6.2012 18:23, Christopher Wood wrote:> On Fri, Jun 22, 2012 at 08:50:59AM -0700, Christian DeKonink wrote: >> foo_bar_1.0.rpm > > > If this is something that you absolutely must do by the end of the day on a Friday because some manager is a maniac, you can deploy the rpm via a file resource and then install it by specifying alternate package type parameters: > > class myrpm { > $myrpm = ''/tmp/foo_bar_1.0.rpm'' > $myrpmsource = "puppet:///modules/myrpm/foo_bar_1.0.rpm" > $mypkg = "foo_bar" > file { $myrpm: > source => $myrpmsource, > } > package { $mypkg: > provider => ''rpm'', > source => $myrpm, > require => File[$myrpm], > } > }The problem with this is that the file has to be downloaded even if the package is already installed. Even if it is already downloaded, it has to present. If you absolutely must do this, /tmp is a poor location because it is not guaranteed that it survives a reboot. Many tmp''s are on tmpfs or similar things and even if it''s on a regular filesystem there could be regular cronjobs removing old files. Maybe a better place would be /var/tmp or puppets $vardir/whatever Something like refreshonly would be handy in this case, but this exec only, I believe. -- Kind Regards, Markus Falb
Thanks for your immediate response. The first solution you propesed worked flawlessly. I like that. Thanks. On Fri, Jun 22, 2012 at 9:23 AM, Christopher Wood < christopher_wood@pobox.com> wrote:> > class myrpm { > package { ''foo_bar'': } > } > > node "myhost.me.com" { > class { ''myrpm'': } > } > > If this is something that you absolutely must do by the end of the day on > a Friday because some manager is a maniac, you can deploy the rpm via a > file resource and then install it by specifying alternate package type > parameters: > > class myrpm { > $myrpm = ''/tmp/foo_bar_1.0.rpm'' > $myrpmsource = "puppet:///modules/myrpm/foo_bar_1.0.rpm" > $mypkg = "foo_bar" > file { $myrpm: > source => $myrpmsource, > } > package { $mypkg: > provider => ''rpm'', > source => $myrpm, > require => File[$myrpm], > } > } > > node "myhost.me.com" { > class { ''myrpm'': } > } > > With the above I am assuming that your classes are in modules (save your > sanity, use them). More on modules: > > http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html > http://docs.puppetlabs.com/module_cheat_sheet.html > > Also remember dependencies: > > http://docs.puppetlabs.com/references/stable/metaparameter.html#require > > And more generally: > > http://docs.puppetlabs.com/guides/language_guide.html > > > > How would I deploy this to all hosts that talk to my puppetmaster? > > Thanks > > Chris > > > > -- > > 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. > > -- > 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. > >-- 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.