Here''s a breadcrumb for someone who runs into this themselves. I ran into an issue where I had the mysql-percona rpm''s in a yum repository, so yum was selecting MySQL-percona-devel when told to install mysql-devel. I needed to pass the -x parameter to yum to get around it. I created a module to extend yum and give me the option to pass custom parameters: # /etc/puppet/modules/package_plus_plugins/puppet/provider/package/yum_plus.rb Puppet::Type.type(:package).provide :yum_plus, :parent => :yum, :source => :rpm do desc "Support via ``yum``." commands :yum_plus => "yum" def yum(*args) yum_plus(*args + @resource[:vendor].split(" ")) end end # then, in my manifest: package { ["mysql", "mysql-devel"]: ensure => present, provider => yum_plus, vendor => "-x *percona*" } Criticisms / peer review welcome. Tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Tim, Yum also supports specifying priorities and exclusions per repo. :) The puppet yum repo type also lets you configure these settings. Gary On Dec 31, 3:26 am, "Tim Harper" <timchar...@gmail.com> wrote:> Here''s a breadcrumb for someone who runs into this themselves. > > I ran into an issue where I had the mysql-percona rpm''s in a yum repository, > so yum was selecting MySQL-percona-devel when told to install mysql-devel. > I needed to pass the -x parameter to yum to get around it. > I created a module to extend yum and give me the option to pass custom > parameters: > > # > /etc/puppet/modules/package_plus_plugins/puppet/provider/package/yum_plus.rb > Puppet::Type.type(:package).provide :yum_plus, :parent => :yum, :source => > :rpm do > desc "Support via ``yum``." > > commands :yum_plus => "yum" > > def yum(*args) > yum_plus(*args + @resource[:vendor].split(" ")) > end > end > > # then, in my manifest: > package { ["mysql", "mysql-devel"]: ensure => present, provider => yum_plus, > vendor => "-x *percona*" } > > Criticisms / peer review welcome. > > Tim--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Gary, That sounds fantastic. I was looking for such a thing - where can I find it? Tim On Tue, Dec 30, 2008 at 8:06 PM, gary <garyyuen@gmail.com> wrote:> > Hello Tim, > > Yum also supports specifying priorities and exclusions per repo. :) > The puppet yum repo type also lets you configure these settings. > > Gary > > On Dec 31, 3:26 am, "Tim Harper" <timchar...@gmail.com> wrote: > > Here''s a breadcrumb for someone who runs into this themselves. > > > > I ran into an issue where I had the mysql-percona rpm''s in a yum > repository, > > so yum was selecting MySQL-percona-devel when told to install > mysql-devel. > > I needed to pass the -x parameter to yum to get around it. > > I created a module to extend yum and give me the option to pass custom > > parameters: > > > > # > > > /etc/puppet/modules/package_plus_plugins/puppet/provider/package/yum_plus.rb > > Puppet::Type.type(:package).provide :yum_plus, :parent => :yum, :source > => > > :rpm do > > desc "Support via ``yum``." > > > > commands :yum_plus => "yum" > > > > def yum(*args) > > yum_plus(*args + @resource[:vendor].split(" ")) > > end > > end > > > > # then, in my manifest: > > package { ["mysql", "mysql-devel"]: ensure => present, provider => > yum_plus, > > vendor => "-x *percona*" } > > > > Criticisms / peer review welcome. > > > > Tim > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Tim, You can specify a repo like this: [mysql-percona] ... enabled=1 priority=20 exclude=mysql-devel,... http://wiki.centos.org/PackageManagement/Yum/ProtectBase http://wiki.centos.org/PackageManagement/Yum/Priorities I have the CentOS repos mostly set at priority 1 and then EPEL at a lower value. If you set the Red Hat/CentOS repo priority to 1 and then rest to a lower value, I think packages of the same name will never get installed from lower priority repos. You may just want exclude instead. The yumrepo native type also lets you specify priorty or exclusions: yumrepo { ''percona'': baseurl => "...", enabled => 1, exclude => "mysql-devel,...", priority => ..., ... } I just started using immerda''s great yum module: https://git.puppet.immerda.ch/ Manging yum repos in puppet let''s you then specify package repo requirements: package{ ''package'': ensure => enabled, require => Yumrepo[''epel''] } Gary On Jan 1, 1:11 am, "Tim Harper" <timchar...@gmail.com> wrote:> Hi Gary, > That sounds fantastic. I was looking for such a thing - where can I find > it? > > Tim > > On Tue, Dec 30, 2008 at 8:06 PM, gary <garyy...@gmail.com> wrote: > > > Hello Tim, > > > Yum also supports specifying priorities and exclusions per repo. :) > > The puppet yum repo type also lets you configure these settings. > > > Gary > > > On Dec 31, 3:26 am, "Tim Harper" <timchar...@gmail.com> wrote: > > > Here''s a breadcrumb for someone who runs into this themselves. > > > > I ran into an issue where I had the mysql-percona rpm''s in a yum > > repository, > > > so yum was selecting MySQL-percona-devel when told to install > > mysql-devel. > > > I needed to pass the -x parameter to yum to get around it. > > > I created a module to extend yum and give me the option to pass custom > > > parameters: > > > > # > > > /etc/puppet/modules/package_plus_plugins/puppet/provider/package/yum_plus.rb > > > Puppet::Type.type(:package).provide :yum_plus, :parent => :yum, :source > > => > > > :rpm do > > > desc "Support via ``yum``." > > > > commands :yum_plus => "yum" > > > > def yum(*args) > > > yum_plus(*args + @resource[:vendor].split(" ")) > > > end > > > end > > > > # then, in my manifest: > > > package { ["mysql", "mysql-devel"]: ensure => present, provider => > > yum_plus, > > > vendor => "-x *percona*" } > > > > Criticisms / peer review welcome. > > > > Tim > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
OK, I misunderstood you, I interpreted you were saying there was a puppet "yum" type (as in an enhanced version of the package type). Still, this is a great approach and solves the issue. Thank you very much. Tim On Wed, Dec 31, 2008 at 12:51 PM, gary <garyyuen@gmail.com> wrote:> > Hello Tim, > > You can specify a repo like this: > > [mysql-percona] > ... > enabled=1 > priority=20 > exclude=mysql-devel,... > > http://wiki.centos.org/PackageManagement/Yum/ProtectBase > http://wiki.centos.org/PackageManagement/Yum/Priorities > > I have the CentOS repos mostly set at priority 1 and then EPEL at a > lower value. If you set the Red Hat/CentOS repo priority to 1 and then > rest to a lower value, I think packages of the same name will never > get installed from lower priority repos. You may just want exclude > instead. > > The yumrepo native type also lets you specify priorty or exclusions: > > yumrepo { ''percona'': > baseurl => "...", > enabled => 1, > exclude => "mysql-devel,...", > priority => ..., > ... > } > > I just started using immerda''s great yum module: > > https://git.puppet.immerda.ch/ > > Manging yum repos in puppet let''s you then specify package repo > requirements: > > package{ ''package'': ensure => enabled, require => Yumrepo[''epel''] } > > Gary > > On Jan 1, 1:11 am, "Tim Harper" <timchar...@gmail.com> wrote: >> Hi Gary, >> That sounds fantastic. I was looking for such a thing - where can I find >> it? >> >> Tim >> >> On Tue, Dec 30, 2008 at 8:06 PM, gary <garyy...@gmail.com> wrote: >> >> > Hello Tim, >> >> > Yum also supports specifying priorities and exclusions per repo. :) >> > The puppet yum repo type also lets you configure these settings. >> >> > Gary >> >> > On Dec 31, 3:26 am, "Tim Harper" <timchar...@gmail.com> wrote: >> > > Here''s a breadcrumb for someone who runs into this themselves. >> >> > > I ran into an issue where I had the mysql-percona rpm''s in a yum >> > repository, >> > > so yum was selecting MySQL-percona-devel when told to install >> > mysql-devel. >> > > I needed to pass the -x parameter to yum to get around it. >> > > I created a module to extend yum and give me the option to pass custom >> > > parameters: >> >> > > # >> >> > /etc/puppet/modules/package_plus_plugins/puppet/provider/package/yum_plus.rb >> > > Puppet::Type.type(:package).provide :yum_plus, :parent => :yum, :source >> > => >> > > :rpm do >> > > desc "Support via ``yum``." >> >> > > commands :yum_plus => "yum" >> >> > > def yum(*args) >> > > yum_plus(*args + @resource[:vendor].split(" ")) >> > > end >> > > end >> >> > > # then, in my manifest: >> > > package { ["mysql", "mysql-devel"]: ensure => present, provider => >> > yum_plus, >> > > vendor => "-x *percona*" } >> >> > > Criticisms / peer review welcome. >> >> > > Tim >> >> > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi all, sorry for breaking the threat, I don''t know where the OP is. anyway, Tim Harper provided yum_plus in order to be able to pass args to yum, in his example, -x option. http://groups.google.com/group/puppet-users/browse_thread/thread/234e84e569a40f61?hl=en# I was looking for something similar cause I''d like to pass groupinstall option. Now I''m doing it with exec type, but it could be better using yum/yum_plus types for thing that (grepping logs). Is puppet planning to support yum args, or Tim''s aproach is the best solution? TIA, Arnau --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Jeffrey Hulten
2009-Jan-07 19:14 UTC
[Puppet Users] Re: solution: excluding packages via yum
For my money the best solution is to use Puppet to manage the yum.conf files and put your excludes there... But that is me. On Wed, Jan 7, 2009 at 8:06 AM, Arnau Bria <arnaubria@pic.es> wrote:> > Hi all, > > sorry for breaking the threat, I don''t know where the OP is. > > anyway, Tim Harper provided yum_plus in order to be able to pass args > to yum, in his example, -x option. > > http://groups.google.com/group/puppet-users/browse_thread/thread/234e84e569a40f61?hl=en# > > I was looking for something similar cause I''d like to pass groupinstall > option. Now I''m doing it with exec type, but it could be better using > yum/yum_plus types for thing that (grepping logs). > > Is puppet planning to support yum args, or Tim''s aproach is the best > solution? > > > TIA, > Arnau > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---