Dan White
2012-Jan-23 15:09 UTC
[Puppet Users] I just discovered I cannot resource-purge yumrepos -- Is there another way ?
I added a bunch of yumrepo resources to my node definitions and thought I''d finish it with a resources { ''yumrepo'': purge => true, } But when I tried to run it, I get this: err: Failed to apply catalog: Parameter purge failed: Purging is only supported on types that accept ''ensure'' at /etc/puppet/manifests/nodes/.... Is there an alternative, non-messy way to do what that statement should do for me ? “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
Stefan Schulte
2012-Jan-23 18:10 UTC
Re: [Puppet Users] I just discovered I cannot resource-purge yumrepos -- Is there another way ?
On Mon, Jan 23, 2012 at 03:09:49PM +0000, Dan White wrote:> I added a bunch of yumrepo resources to my node definitions and thought I''d finish it with a > > resources { ''yumrepo'': purge => true, } > > But when I tried to run it, I get this: > > err: Failed to apply catalog: Parameter purge failed: Purging is only supported on types that accept ''ensure'' at /etc/puppet/manifests/nodes/.... >While I don''t have a workaround for you, there is a featurerequest to accomplish resource purging http://projects.puppetlabs.com/issues/9293 -Stefan
Dan White
2012-Jan-23 18:54 UTC
Re: [Puppet Users] I just discovered I cannot resource-purge yumrepos -- Is there another way ?
That the problem is known is a comfort. I will trash my way around it one way or another, and if I come up with any neato tricks for removal of a repo, I will contact the list and/or the Feature Assignee :) “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Stefan Schulte <stefan.schulte@taunusstein.net> wrote:> On Mon, Jan 23, 2012 at 03:09:49PM +0000, Dan White wrote: > > I added a bunch of yumrepo resources to my node definitions and thought I''d finish it with a > > > > resources { ''yumrepo'': purge => true, } > > > > But when I tried to run it, I get this: > > > > err: Failed to apply catalog: Parameter purge failed: Purging is only supported on types that accept ''ensure'' at /etc/puppet/manifests/nodes/.... > > > > While I don''t have a workaround for you, there is a featurerequest to > accomplish resource purging > > http://projects.puppetlabs.com/issues/9293 > > -Stefan-- 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.
Eric Sorenson
2012-Jan-24 03:40 UTC
Re: [Puppet Users] I just discovered I cannot resource-purge yumrepos -- Is there another way ?
This is sort of hackish but not too bad... set a list of file resources that are the resultant names of the /etc/yum.repos.d/<blah>.repo files, and purge everything else in that directory. class yum::cleanup { # shorthand for the repo directory $rd = "/etc/yum.repos.d" # clean the yum.repos.d directory of any non-managed files file { "$rd": ensure => directory, purge => true, recurse => true } # NOTE: If you add a new yumrepo, make a matching file resource here! file { [ "$rd/local.repo", "$rd/os.repo", "$rd/base.repo", ] : ensure => present, } } class yum::repositories { require yum::cleanup yumrepo { "os" .... etc ... } } -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/62XjufqJOh8J. 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.
Dan White
2012-Jan-24 14:25 UTC
Re: [Puppet Users] I just discovered I cannot resource-purge yumrepos -- Is there another way ?
Thank you. Simple enough to ignore the hack-ish nature :) Looks like it will do the job All it needs are a few yum commands to run whenever the file changes to refresh the local databse. I will tinker with that and report back to the list. Pay It Forward ! Share & Enjoy ! “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Eric Sorenson <eric.sorenson@me.com> wrote:> This is sort of hackish but not too bad... set a list of file resources > that are the resultant names of the /etc/yum.repos.d/<blah>.repo files, and > purge everything else in that directory. > > class yum::cleanup { > # shorthand for the repo directory > $rd = "/etc/yum.repos.d" > > # clean the yum.repos.d directory of any non-managed files > file { "$rd": ensure => directory, purge => true, recurse => true } > > # NOTE: If you add a new yumrepo, make a matching file resource here! > file { [ "$rd/local.repo", > "$rd/os.repo", > "$rd/base.repo", ] : > ensure => present, > } > > } > > class yum::repositories { > require yum::cleanup > > yumrepo { "os" > > .... etc ... > > } > > } > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/62XjufqJOh8J. > 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. >-- 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.