Issue #1843 has been updated by luke.

Status changed from Unreviewed to Needs more information

Hmm, I don't know the Yumrepo type all that well, but you're probably right 
about it reading the whole file in at the beginning of the transaction, thus 
not catching changes made by the RPM.

Can you just ignore the Yum repos made by the rpm and recreate them?  That is, 
respecify them entirely?
----------------------------------------
Bug #1843: race condition or caching problem with yumrepo and exec
http://projects.reductivelabs.com/issues/show/1843

Author: mconigliaro
Status: Needs more information
Priority: Normal
Assigned to: 
Category: yumrepo
Target version: 
Complexity: Unknown
Affected version: 0.24.6
Keywords: 


Hello,

I'm trying to use puppet to manage some RPM repos on CentOS 5.2.  I've created 
a recipe that uses the exec type to create the appropriate .repo files (by 
installing an RPM) and then sets the priority for each repo via the yumrepo 
type:

<pre>
class yum {
    package { "yum-priorities": ensure => installed }
    yumrepo {
        ["base", "updates", "addons", "extras"]: priority => "1";
        "centosplus": priority => "2";
        "xensource": priority => "10";
        ["epel", "epel-debuginfo", "epel-source", "epel-testing", 
"epel-testing-debuginfo", "epel-testing-source"]:
            require  => Exec["install-epel"],
            priority => "20";
        "rpmforge":
            require  => Exec["install-rpmforge"],
            priority => "30",
    }
    exec {
        "install-epel":
            command => "rpm -U --force 
http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm";,
            creates => ["/etc/yum.repos.d/epel.repo", 
"/etc/yum.repos.d/epel-testing.repo"];
        "install-rpmforge":
            command => "rpm -U --force 
http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm";,
            creates => "/etc/yum.repos.d/rpmforge.repo",
    }
}
</pre>

What should happen is that the RPM gets installed first, then the yumrepo type 
will see the new .repo files and modify them appropriately.  Unfortunately, 
even though everything is happening in the correct order, puppet does not see 
the new .repo files and creates its own (resulting in invalid .repo files). I 
temporarily modified the exec lines to do an "ls /etc/yum.repos.d/" and used 
logoutput just to make sure the .repo files were being created.

<pre>
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: 
CentOS-Base.repo
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: 
CentOS-Media.repo
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: 
XenSource.repo
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: 
mirrors-rpmforge
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: 
rpmforge.repo
notice: //Node[default]/baseclass/yum/Exec[install-rpmforge]/returns: executed 
successfully
info: create new repo rpmforge in file /etc/yum.repos.d/rpmforge.repo
</pre>

notice that even though the rpmforge.repo file is there (line 7), puppet wants 
to create a new one (line 9).


----------------------------------------
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://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to