Hi,

I have next to no experience with yum, but generally you should try and

1. use the yumrepo type:
https://docs.puppetlabs.com/references/latest/type.html#yumrepo
2. make sure the package *require* the repository
3. perhaps pass the enablerepo option via the install_options parameter:
https://docs.puppetlabs.com/references/latest/type.html#package-attribute-install_options

HTH,
Felix

On 01/06/2015 03:59 PM, staceytian4...@gmail.com wrote:
> Hi,
>
> I am using open source Puppet 3.7.3. There are multiple yum repos on
> the puppet agent machines. So when I use Puppet to push a package, can
> I force Puppet to use a specific yum repo?
>
> For example, here is my module for pushing Firefox:
>
> class firefox::checkff inherits firefox {
>   if ( ($operatingsystemrelease >= 6.5) and ($hardwareisa == 'x86_64') ) {
>  
>     file { "/etc/yum.repos.d/firefox.31.2.x86_64.repo":
>       ensure => present,
>       source => "/templates/Linux/yum.repos.d/firefox.31.2.x86_64.repo",
>       mode => '0644',
>       owner => 'root',
>     }
>
>     package { "gtk2":
>       ensure => '2.24.23-6.el6',
>     }
>
>     package { "firefox":
>       ensure => '31.2.0-3.el6_6',
>       subscribe => [ Package['gtk2'] ],
>     }
>   }
> }
>
> You can see that I make sure my firefox.31.2.x86_64.repo is copied to
> the local machine's /etc/yum.repos.d, but I found out that my puppet
> agent will still try to get the firefox package from my Satellite
> server instead of installing from the local firefox repo.
>
> Is there any way to force Puppet to use a specific yum repo?
>
> Thanks,
> Stacey

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/54AC6B4A.7030007%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to