How do I enable repositories and install packages

1,172 views
Skip to first unread message

hyzhang

unread,
Jun 1, 2011, 12:19:32 PM6/1/11
to Puppet Users
Hi,

My shell script is as below. How do I translate them to puppet
language? I think I can use exec directly. But is there a better way?

/usr/bin/yum clean all
/bin/echo -e "\n/usr/bin/yum -y --enablerepo=base,rpmforge install
mplayer mplayer-skins"
/usr/bin/yum -y --enablerepo=base,rpmforge install mplayer mplayer-
skins

/usr/bin/yum clean all
/bin/echo -e "\n/usr/bin/yum -y --nogpgcheck install RealPlayer
AdobeReader_enu flash-plugin"
/usr/bin/yum -y --nogpgcheck install RealPlayer AdobeReader_enu flash-
plugin

/usr/bin/yum clean all
/bin/echo -e "\n/usr/bin/yum -y --enablerepo=base install pidgin"
/usr/bin/yum -y --enablerepo=base install pidgin

Thanks,
-Haiyan

Nathan Clemons

unread,
Jun 1, 2011, 12:31:51 PM6/1/11
to puppet...@googlegroups.com
The package resource type will allow you to install packages via Yum, but does not (last I checked) support specifying repos to enable/disable (which I'd dearly love if it was added).

Which means you either get to write your own extension to package to add that functionality, or use exec.

--
Nathan Clemons
The worlds largest online language learning community




--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Jacob Helwig

unread,
Jun 1, 2011, 12:41:38 PM6/1/11
to puppet...@googlegroups.com
If you want to enable the repositories on a per-package basis as was
shown in the examples (with the --enablerepo flag), then you'll
definitely want to watch & vote for #4113[1].

If you want to have the repositories always enabled, then you should be
able to do that through the yum configuration. I'm not all that
familiar with the details though since I've tended not to use the RPM
based systems.

[1] http://projects.puppetlabs.com/issues/4113

--
Jacob Helwig

signature.asc

hyzhang

unread,
Jun 3, 2011, 1:11:10 PM6/3/11
to Puppet Users
Thank you all for the response. I applied the patch. It seems work
partially, but failed due to packages is not signed. So that raises
another question - is there a puppet patch for "nogpgcheck"?

On Jun 1, 12:41 pm, Jacob Helwig <ja...@puppetlabs.com> wrote:
> If you want to enable the repositories on a per-package basis as was
> shown in the examples (with the --enablerepo flag), then you'll
> definitely want to watch & vote for #4113[1].
>
> If you want to have the repositories always enabled, then you should be
> able to do that through the yum configuration.  I'm not all that
> familiar with the details though since I've tended not to use the RPM
> based systems.
>
> [1]http://projects.puppetlabs.com/issues/4113
>
> --
> Jacob Helwig
>
> On Wed, 01 Jun 2011 09:31:51 -0700, Nathan Clemons wrote:
>
> > The package resource type will allow you to install packages via Yum, but
> > does not (last I checked) support specifying repos to enable/disable (which
> > I'd dearly love if it was added).
>
> > Which means you either get to write your own extension to package to add
> > that functionality, or use exec.
>
> > --
> > Nathan Clemons
> >http://www.livemocha.com
> > The worlds largest online language learning community
>
> > On Wed, Jun 1, 2011 at 9:19 AM, hyzhang <hyzh...@jcvi.org> wrote:
>
> > > Hi,
>
> > > My shell script is as below. How do I translate them to puppet
> > > language? I think I can use exec directly. But is there a better way?
>
> > > /usr/bin/yum clean all
> > > /bin/echo -e "\n/usr/bin/yum -y --enablerepo=base,rpmforge install
> > > mplayer mplayer-skins"
> > > /usr/bin/yum -y --enablerepo=base,rpmforge install mplayer mplayer-
> > > skins
>
> > > /usr/bin/yum clean all
> > > /bin/echo -e "\n/usr/bin/yum -y --nogpgcheck install RealPlayer
> > > AdobeReader_enu flash-plugin"
> > > /usr/bin/yum -y --nogpgcheck install RealPlayer AdobeReader_enu flash-
> > > plugin
>
> > > /usr/bin/yum clean all
> > > /bin/echo -e "\n/usr/bin/yum -y --enablerepo=base install pidgin"
> > > /usr/bin/yum -y --enablerepo=base install pidgin
>
> > > Thanks,
> > > -Haiyan
>
>
>
>  signature.asc
> < 1KViewDownload

Matthew Black

unread,
Jun 3, 2011, 1:20:02 PM6/3/11
to puppet...@googlegroups.com
It fails because the yum repository by default is requiring the package be
signed. If you update the repo configuration, with the option below, you
would not need to do a --nogpgcheck with the package install. The only other
time that this option would not work is if you are doing a localinstall via
yum, which there is no repo configuration involved.

gpgcheck=0

--

Reply all
Reply to author
Forward
0 new messages