Feature #1023

yumrepo option to purge unmanaged repos

Added by Ben - over 4 years ago. Updated 9 months ago.

Status:Duplicate Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:yumrepo
Target version:-
Affected Puppet version:0.24.8 Branch:
Keywords:
Votes: 8

Description

it would be nice if there was a way to purge any yum repo’s that were not managed by puppet.

file { "/etc/yum.repos.d": ensure => directory, recurse => true, purge => true }

a file type purge would work if the resulting repo file from a yumrepo type was labeled as a file resource too.


Related issues

duplicates Puppet - Feature #9293: yum repos should be ensurable. Accepted 08/31/2011

History

Updated by James Turnbull over 4 years ago

Have you looked at the resource type – http://reductivelabs.com/trac/puppet/wiki/TypeReference#resources?

Updated by Ben - over 4 years ago

Thankyou i was not aware of that type, however it doesn’t do it. It raises an error.

err: Could not create yumrepo: Parameter purge failed: Purging is only supported on types that accept 'ensure'

Updated by James Turnbull over 4 years ago

  • Status changed from 1 to Closed
  • 7 set to duplicate

Closing as duplicate of [#949]

Updated by Teyo Tyree over 2 years ago

  • Status changed from Closed to Re-opened
  • Assignee deleted (Puppet Community)
  • Affected Puppet version set to 0.24.8

949 is not a duplicate of this ticket. #949 asks for the ability to “ensure => absent” as well as “present”. The yumrepo resource is not currently “ensurable” and thusly can not be purged using the “resources” resource type. Purging allows us to declare that only managed repos will be available on a host. All other repos will be removed.

Updated by Joshua Corbin almost 2 years ago

Would it be possible for yumrepo to simply define a File resource and update the content of the file through that? This would allow for: * Tidying of /etc/yum.repos.d * Filebucketing of the managed file (#2027)

This would’ve been trivial with a macro:

define yumrepo(...) {
file {"/etc/yum.repos.d/$name.repo":
    ...
}

}

Updated by Peter Meier almost 2 years ago

This would’ve been trivial with a macro:

define yumrepo(...) {
file {"/etc/yum.repos.d/$name.repo":
    ...
}

}

as done here: http://git.puppet.immerda.ch/?p=module-yum.git

Updated by James Turnbull over 1 year ago

  • Category set to yumrepo
  • Status changed from Re-opened to Needs Decision
  • Assignee set to Nigel Kersten

Updated by Nigel Kersten over 1 year ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Nigel Kersten)

You should be able to purge repositories not managed by Puppet, yes.

Updated by Nigel Kersten 9 months ago

  • Status changed from Accepted to Duplicate

Duping in favor of another ticket to make it ensurable that references these two.

Also available in: Atom PDF