The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Feature #9293

yum repos should be ensurable.

Added by Nigel Kersten over 4 years ago. Updated over 2 years ago.

Status:In Topic Branch Pending ReviewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:yumrepo
Target version:3.x
Affected Puppet version: Branch:https://github.com/puppetlabs/puppet/pull/2086
Keywords:customer

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-1066


Description

This should be done so that we can solve:

#949 – yumrepo should support removal of repository

#1023 – yumrepo option to purge unmanaged repos

yumrepo.rb Magnifier - Provider, should go in lib/provider/yumrepo/yumrepo.rb (1.25 KB) Daniel Lobato Garcia, 10/26/2012 01:12 am

yumrepo.rb Magnifier - Type, should go in lib/type/yumrepo.rb (11.7 KB) Daniel Lobato Garcia, 10/26/2012 01:12 am


Related issues

Related to Puppet - Refactor #8758: Yumrepo should be refactored to use a provider In Topic Branch Pending Review
Duplicated by Puppet - Feature #949: yumrepo should support removal of repository Duplicate
Duplicated by Puppet - Feature #1023: yumrepo option to purge unmanaged repos Duplicate
Duplicated by Puppet - Bug #12687: RFE: yumrepo enabled absent removes repo file Duplicate 02/16/2012

History

#1 Updated by Nigel Kersten over 4 years ago

  • Description updated (diff)

#2 Updated by Nigel Kersten over 4 years ago

  • Description updated (diff)

#3 Updated by Nigel Kersten over 4 years ago

  • Category set to yumrepo

#4 Updated by K Hightower over 4 years ago

  • Assignee set to K Hightower

#5 Updated by K Hightower over 4 years ago

  • Assignee deleted (K Hightower)

#6 Updated by Bill Tong over 4 years ago

Does anyone have a workaround for this in the meantime? Something like retrieving a list of files managed by the yumrepo type and deleting everything else?

#7 Updated by Steve Traylen almost 4 years ago

As a work around this is fairly easy to use, define a new resource

define osrepos::ai121yumrepo ($enabled,$baseurl,$descr,$includepkgs='absent',$gpgcheck='1',$gpgkey='absent',$priority='99') {

$filename = $title

yumrepo{$filename:
   descr        => $descr,
   enabled      => $enabled,
   baseurl      => $baseurl,
   includepkgs  => $includepkgs,
   gpgcheck     => $gpgcheck,
   gpgkey       => $gpgkey,
   priority     => $priority
 }
 file {"/etc/yum.repos.d/${filename}.repo":
     ensure  => present,
     require => [Yumrepo[$title],Package['yum']]
 }
}

Add some where a purge

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

And then define each of your yumrepos not as

yumrepo{'myrepo':
  descr => 'lakdjfa'
 baseurl => 'http://...
}

but as

osrepos:ai121yumrepo{'myrepo':
  descr => 'lakdjfa'
  baseurl => 'http://...
}

You can still use the normal

package{'xyz':
   ensure => present,
   require => Yumrepo['myrepo']
}

where ever you like.

#8 Updated by Daniel Lobato Garcia over 3 years ago

I have implemented this using a provider for yumrepo which makes it ensurable. Have only tested it in 2.7.18 but it should be fine in 3.x.

https://github.com/puppetlabs/puppet/pull/1236

#9 Updated by Daniel Lobato Garcia over 3 years ago

Daniel Lobato Garcia wrote:

I have implemented this using a provider for yumrepo which makes it ensurable. Have only tested it in 2.7.18 but it should be fine in 3.x.

https://github.com/puppetlabs/puppet/pull/1236

Done some changes to the provider. Thoughts? https://github.com/puppetlabs/puppet/pull/1236

#10 Updated by Anonymous about 3 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/1236

#11 Updated by Anonymous about 3 years ago

  • Status changed from In Topic Branch Pending Review to Tests Insufficient

#12 Updated by Nick Barringer over 2 years ago

  • Assignee set to Nick Barringer

#14 Updated by Reid Vandewiele over 2 years ago

  • Assignee deleted (Nick Barringer)

#15 Updated by Charlie Sharpsteen over 2 years ago

  • Keywords set to customer

#17 Updated by Charlie Sharpsteen over 2 years ago

  • Status changed from Tests Insufficient to In Topic Branch Pending Review
  • Start date deleted (08/31/2011)
  • Branch changed from https://github.com/puppetlabs/puppet/pull/1236 to https://github.com/puppetlabs/puppet/pull/2086

#18 Updated by Jason Antman over 2 years ago

Redmine Issue #9293 has been migrated to JIRA:

https://tickets.puppetlabs.com/browse/PUP-1066

Also available in: Atom PDF