On Nov 20, 2012, at 4:15 PM, Laurence Cope wrote:
> Hi
>
> I am trying to install a yum repo using puppet, so they can install a
> package. But i am struggling. I cannot find much help online at all.
>
> The only code I got working was as follows, but it works first time, but
> additional times it gives an error due to it being installed. Does it matter
> I get Resource failed messages due to it being installed, or is there a check
> to see if its installed, or am I using the wrong code? All other code I found
> online gavce errors and does not even create it.
>
> Thanks
>
> class yum
> {
> define packages::repo_release ($source) {
> exec { $name:
> command =>"/bin/rpm -ivh ${source}",
> creates => "/etc/yum.repos.d/${name}.repo",
> }
> }
>
> packages::repo_release { "virtualmin":
> source =>
>
> "http://software.virtualmin.com/bleed/centos/5/i386/virtualmin-bleed-release-1.0-1.rhel.noarch.rpm",
> }
> }
>
You'll want to use the yumrepo resource, documented here:
http://docs.puppetlabs.com/references/latest/type.html#yumrepo
Here's an example of a basic yumrepo block:
yumrepo { "myrepo":
baseurl =>
"http://local.server.org/myrepo/$operatingsystem/$operatingsystemrelease/$architecture",
descr => "My Local Repo",
enabled => 1,
gpgcheck => 0,
}
--
Peter
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.