Hey guys, puppet n00b here. I think I already found an answer for my question here, but the topic was dated back in november of 2011, so I''m hoping things have changed since then! Here''s the topic I''m referring to. https://groups.google.com/forum/?fromgroups#!topic/puppet-users/oSHWWjMX-sE I''m running: CentOS 6.3 yum 3.2.29 puppet 3.2.1 To sum it up, I would like to* install an RPM which I have saved locally on the target machine using puppet and yum*. Couple reasons: - I want yum to resolve dependencies for me. - I need to install a custom-packaged version of collectd (v5, since EPEL only has v4, and we''ve made some customizations). Here''s a code snippet:> package { ''collectd'': > ensure => $ensure_pkg, > source => $localInstallPath, > #provider => rpm, > }If I use provider == rpm, it works fine assuming I already have the dependencies installed. But I won''t, on new machines. Of course I could install those using other puppet modules, but I find it kind of annoying that I need to build yet more puppet modules just to install dependencies, especially since that''s what yum is there for. When I leave provider commented out, puppet defaults to yum. Problem is, it doesn''t use my source param, $localInstallPath. I''ve seen other folks point to sources over http, which apparently works fine (meaning, source => "http://someserver.com/mycustom.rpm"). But when I specify a local path in my variable (like "/home/test/rpms/mycustom.rpm") it doesn''t get used: ..snip.. Debug: Prefetching yum resources for package> Debug: Executing ''/bin/rpm --version'' > Debug: Executing ''/bin/rpm -qa --nosignature --nodigest --qf ''%{NAME} > %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > '''' > Debug: Executing ''/bin/rpm -q collectd --nosignature --nodigest --qf > %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > '' > Debug: Package[collectd](provider=yum): Ensuring => present > *Debug: Executing ''/usr/bin/yum -d 0 -e 0 -y install collectd''* > Debug: Executing ''/bin/rpm -q collectd --nosignature --nodigest --qf > %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > ''Ideally, all I want to change is:> /usr/bin/yum -d 0 -e 0 -y install collectdto> /usr/bin/yum -d 0 -e 0 -y install /home/test/rpms/collectd.blah.rpmSo, any hints? Is there some parameter other than source that I can pass into my package def that will force it to do this install from a local RPM? Thanks! P -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Dan White
2013-Jun-08 17:56 UTC
Re: [Puppet Users] Using yum provider to install local RPM
If the local install is not working, then just do it from your custom, local repo Make sure the local repo is enabled on the agent ( puppet type yumrepo ) and then set the yum priorities so that your repo has a higher priority than the EPEL repo http://wiki.centos.org/PackageManagement/Yum/Priorities That works for me. On Jun 7, 2013, at 9:24 PM, Paul Pham wrote:> Hey guys, puppet n00b here. I think I already found an answer for my question here, but the topic was dated back in november of 2011, so I''m hoping things have changed since then! Here''s the topic I''m referring to. > https://groups.google.com/forum/?fromgroups#!topic/puppet-users/oSHWWjMX-sE > > I''m running: > CentOS 6.3 > yum 3.2.29 > puppet 3.2.1 > > To sum it up, I would like to install an RPM which I have saved locally on the target machine using puppet and yum. Couple reasons: > I want yum to resolve dependencies for me. > I need to install a custom-packaged version of collectd (v5, since EPEL only has v4, and we''ve made some customizations). > Here''s a code snippet: > package { ''collectd'': > ensure => $ensure_pkg, > source => $localInstallPath, > #provider => rpm, > } > > If I use provider == rpm, it works fine assuming I already have the dependencies installed. But I won''t, on new machines. Of course I could install those using other puppet modules, but I find it kind of annoying that I need to build yet more puppet modules just to install dependencies, especially since that''s what yum is there for. > > When I leave provider commented out, puppet defaults to yum. Problem is, it doesn''t use my source param, $localInstallPath. I''ve seen other folks point to sources over http, which apparently works fine (meaning, source => "http://someserver.com/mycustom.rpm"). But when I specify a local path in my variable (like "/home/test/rpms/mycustom.rpm") it doesn''t get used: > > ..snip.. > Debug: Prefetching yum resources for package > Debug: Executing ''/bin/rpm --version'' > Debug: Executing ''/bin/rpm -qa --nosignature --nodigest --qf ''%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > '''' > Debug: Executing ''/bin/rpm -q collectd --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > '' > Debug: Package[collectd](provider=yum): Ensuring => present > Debug: Executing ''/usr/bin/yum -d 0 -e 0 -y install collectd'' > Debug: Executing ''/bin/rpm -q collectd --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} > '' > > Ideally, all I want to change is: > /usr/bin/yum -d 0 -e 0 -y install collectd > to > /usr/bin/yum -d 0 -e 0 -y install /home/test/rpms/collectd.blah.rpm > > So, any hints? Is there some parameter other than source that I can pass into my package def that will force it to do this install from a local RPM? > > Thanks! > P > > -- > 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 puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > >-- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Jun-10 14:18 UTC
Re: [Puppet Users] Using yum provider to install local RPM
On Saturday, June 8, 2013 12:56:22 PM UTC-5, Ygor wrote:> > If the local install is not working, then just do it from your custom, > local repo > >+1 for setting up a local repository. This is FAR better than slinging around RPM files (semi-)manually or serving them directly from some shared filesystem. John -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Paul Pham
2013-Jun-10 19:09 UTC
Re: [Puppet Users] Using yum provider to install local RPM
Totally agree with both of you, and we had planned on setting up our custom repo in the near future. This was really just going to be an interim solution for us, and more generally an optional solution for adhoc/masterless puppet deployments. While I think having a custom repo is the elegant and scalable solution, I still think there are scenarios where it doesn''t make sense to spin up a yum server (or deploy one on the localhost) just so I can install an rpm that''s sitting in my home directory. Given that yum supports the ability to install from local, I''d still call this a puppet bug :) Anyway, thanks for the input, sounds like the yum repo just became a higher priority. P On Monday, June 10, 2013 7:18:05 AM UTC-7, jcbollinger wrote:> > > > On Saturday, June 8, 2013 12:56:22 PM UTC-5, Ygor wrote: >> >> If the local install is not working, then just do it from your custom, >> local repo >> >> > > +1 for setting up a local repository. This is FAR better than slinging > around RPM files (semi-)manually or serving them directly from some shared > filesystem. > > > John > >-- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Brian Mathis
2013-Jun-10 23:32 UTC
Re: [Puppet Users] Using yum provider to install local RPM
I''ve been playing with this a little (currently a work in progress). The idea is to create a package repository on the node itself, like in /var/lib/local_packages, then create a yum repo config that points to the local filesystem. I''m using a defined type to add files to the local repository, then kick off createrepo to update the repo metadata. This is sort of a half-way solution between a total hack and "doing it perfectly correct" with a central yum repo server. ❧ Brian Mathis On Mon, Jun 10, 2013 at 3:09 PM, Paul Pham <me@paulpham.net> wrote:> Totally agree with both of you, and we had planned on setting up our > custom repo in the near future. This was really just going to be an interim > solution for us, and more generally an optional solution for > adhoc/masterless puppet deployments. While I think having a custom repo is > the elegant and scalable solution, I still think there are scenarios where > it doesn''t make sense to spin up a yum server (or deploy one on the > localhost) just so I can install an rpm that''s sitting in my home > directory. Given that yum supports the ability to install from local, I''d > still call this a puppet bug :) > > Anyway, thanks for the input, sounds like the yum repo just became a > higher priority. > > P > > > On Monday, June 10, 2013 7:18:05 AM UTC-7, jcbollinger wrote: >> >> >> >> On Saturday, June 8, 2013 12:56:22 PM UTC-5, Ygor wrote: >>> >>> If the local install is not working, then just do it from your custom, >>> local repo >>> >>> >> >> +1 for setting up a local repository. This is FAR better than slinging >> around RPM files (semi-)manually or serving them directly from some shared >> filesystem. >> >> >> John >> >> -- > 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 puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.