Issue #23011 has been updated by Charlie Sharpsteen. Category set to yumrepo Status changed from Unreviewed to Duplicate Keywords changed from yumrepo to prefetch
Definitely a duplicate of #1238. The bottom line is that Yumrepo can't properly manage repo files created by other resources. Due to prefetching, Yumrepo can only manage those repo files that are already in existence at the beginning of the puppet run plus any that are created by yumrepo resources. #1238 presents a workaround that uses Augeas to manage the contents of `*.repo` files created by packages or file resources. ---------------------------------------- Bug #23011: mixing manual and yumrepo changes produces errors https://projects.puppetlabs.com/issues/23011#change-99904 * Author: Brano Zarnovican * Status: Duplicate * Priority: Normal * Assignee: * Category: yumrepo * Target version: * Affected Puppet version: * Keywords: prefetch * Branch: ---------------------------------------- Hi, if you make modifications on /etc/yum.repos.d/ with 'package' or 'file' it will break 'yumrepo' type. Some RPM packages provide .repo files, so if you would like to add/remove that repo you should add/remove corresponding package. If you mix these modifications "in-between" yumrepo calls, it will produce strange behavior. # Steps to reproduce: 1) start with clean slate rm -f /etc/yum.repos.d/* 2) prepare setup, create three dummy repos yumrepo { [ "foo1", "foo2", "foo3", ]: enabled => 0, } 3) apply this code yumrepo { "foo1": enabled => 0, } -> file { "/etc/yum.repos.d/foo2.repo": ensure => absent, } -> yumrepo { "foo3": enabled => 1, } # Expected result: Changes should be applied without error # Actual result: # puppet apply /var/tmp/yumrepo-issue1.pp Notice: /File[/etc/yum.repos.d/foo2.repo]/ensure: removed Notice: /Stage[main]//Yumrepo[foo3]/enabled: enabled changed '0' to '1' Error: /Stage[main]//Yumrepo[foo3]: Could not evaluate: No such file or directory - /etc/yum.repos.d/foo2.repo Notice: Finished catalog run in 0.12 seconds Making change on repo foo3 will produce an error related to repo foo2. This issue is highly dependent on the ordering in catalog. People (like myself) usually make changes to independent repos in unrelated classes. It will then randomly fail or work. I have a strong suspicion that this is related to #1238 # Workaround: Group all manual changes to /etc/yum.repos.d before (or after) any yumrepo call. For example in separate stage (prerepo -> repo -> main). -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/groups/opt_out.
