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 [email protected].
> To post to this group, send email to [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to