-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

To second Doug, I also uses a module for each repo I want to add.
This way you can probably have a base profile, like the following :

class profile::base {

  resources { 'yumrepo' :
    purge => true,
  }

  include ::epel
  include ::nginx
  include ::repoforge
}

And only the module you specify will be enabled. It will be clear for
whoever look at the code which repo are to be enabled.

- --
Yanis Guenane

On 07/07/2014 12:01 PM, Doug Forster wrote:
> Max,
> 
> I do a single module for each repo that I want added. In some cases
> I combine it with a repo to manage the service. IE mysql* repos
> would be managed via the mysql module.
> 
> As for making sure they are all up to date I might just create an 
> exec {my_check_update: refreshonly => true, command => "yum
> check-update", }
> 
> I might even try to setup a global dependency in your site.pp.
> Someone else probably has a smarter idea though. Yumrepo { notify
> => Exec[my_check_update] }
> 
> In case you may have missed it on all my vagrant boxes I run a yum 
> check-update each time they are provisioned. Vagrant.configure("2")
> do |config| config.vm.provision "shell", inline: "yum
> check-update" end
> 
> Hope it helps. :) Doug
> 
> 
> On Mon, Jul 7, 2014 at 9:35 AM, Andrei Maxim
> <[email protected]> wrote:
> 
>> Hi,
>> 
>> I've been looking into Puppet recently and I'm trying to setup a
>> couple of virtual machines that should mimick what's in
>> production. I'm pretty much a developer trying to lean towards
>> DevOps :-)
>> 
>> Locally, I'm using Vagrant and the CentOS 6.5 64-bit box with
>> Puppet 3.4.3 that was published by Puppetlabs, which should
>> somewhat mirror what's on the servers (a custom AMI based on
>> CentOS 6.5).
>> 
>> What I'm trying to do right now -- and I've found a bunch of ways
>> to do this -- is to setup a couple of repositories (EPEL and
>> MySQL Community being the most important ones). I've noticed that
>> people do this in a number of ways, from grabbing the RPM package
>> to using the 'yumrepo' type to adding a custom module for each
>> repo or by using a general purpose Yum module (like the one from
>> example42) and specifying the repos there.
>> 
>> Normally, when I install those repos, I download the RPM locally
>> and install it using the command line, for example:
>> 
>> yum install http://dev.mysql.com/get/ 
>> mysql-community-release-el6-5.noarch.rpm
>> 
>> That RPM will create a number of entries in the
>> /etc/yum.repos.d/, which seems odd to add each one by hand using
>> the `yumrepo` type.
>> 
>> I've seen this example given a number of times (it's also the
>> correct answer to a similar question on SO):
>> 
>> node default { include base }
>> 
>> class base { yumrepo { "IUS": baseurl =>
>> "http://dl.iuscommunity.org/pub/ius/stable/$ 
>> operatingsystem/$operatingsystemrelease/$architecture", descr =>
>> "IUS Community repository", enabled => 1, gpgcheck => 0 } }
>> 
>> Then, for any node that extends base you can say class foo { 
>> package { "bar": ensure => installed, require => Yumrepo["IUS"]
>> } }
>> 
>> Going back to the example with the MySQL Community RPM, I would
>> have to manually do this for three repos (the other two are
>> disabled):
>> 
>> * mysql-connectors-community * mysql-tools-community *
>> mysql56-community
>> 
>> Is this still the accepted solution in the Puppet community? If
>> so, how would you organize those repositories? Create a module
>> for each repository? Create a repository module with all the
>> sources?
>> 
>> And, somewhat related to this subject, I've noticed that I might
>> get some errors when provisioning my VMs because the base system
>> wasn't up to date. I was planning to add a `yum update` command
>> to my setup, but I realize that this might not be the best
>> solution because I might not want to update the base system
>> everytime I run puppet.
>> 
>> What's the best way to update the system only when running Puppet
>> for the first time?
>> 
>> Thanks, Max
>> 
>> 
>> -- 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/lpeenc%243ai%241%40ger.gmane.org. For more
>> options, visit https://groups.google.com/d/optout.
>> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTut2vAAoJEPh7fjCNYlpntCIH/3nT5kw7XLesDyUkP7fiE17H
gTl77/7bOHeJxHWWHeeTyzh5X/EjRYzl+sA/BasyLTMQjrAUFJc9ZP/ARFbOn1My
wuEBTpaeLzeH+pTMT6fER0vD0GsJVSnA2jasn5czT88Ql6PLGXfGhKJnI9NvKCe3
Ic5Hjuj+IKpTFMUQ+/ZznRdIKBiaMJ2+RLb/6kIFc/yYYoAMXZbMJMyeLhOwH1jK
iyKLMZjI98Bh2rz6mIZGK4Ey2f0r1QjqK/3wDiDMoERj/O+qM5vBRazxgSLXYra3
ewG0r7LQx8LNKgxSuKUMwYdTruPsZNMIm6o76cpFB6l2CuKlAQ9R4dK5rstUsng=
=r7Zl
-----END PGP SIGNATURE-----

-- 
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/53BADDB8.2060303%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to