Issue #1238 has been updated by Tim Rupp.

Jan Ivar Beddari wrote:
> Maybe it is more of a documentation issue? Instead of having people resort to 
> stages and whatnot to solve this (which makes me shiver) why not document 
> better how you convert a repo config rpm to yumrepo resources? This is what 
> gets most people.
> 
> The end section of [Chaining resources in the Language 
> Guide](http://docs.puppetlabs.com/guides/language_guide.html#chaining-resources)
>  gives some hints, but yum/apt configuration is so common there should be a 
> best practices doc somewhere. Doing a search of [yumrepo 
> site:docs.puppetlabs.com](http://www.google.com/search?&q=yumrepo+site:docs.puppetlabs.com)
>  isn't too useful ...
> 
> Issue #2062 is somewhat related.

Chaining does not solve the problem. The repositories defined in yumrepo 
resources still step on the repositories created by yum packages regardless of 
whether there is a "require" dependency on the yumrepo resource or you use a 
Package -> Yumrepo chain.

The reason one would not want to convert yum repositories installed via 
packages to yumrepo resources is because a package can be updated and 
maintained via the "latest" metadata option of the Package resource.

Nightly yum updates, or manual updates, would then pull those new changes and 
require no modification of the puppet manifests. If you manually configure all 
your yum repositories using the yumrepo resource, you are stating that those 
definitions will not change unless manually changed by the puppet 
administrator; that's not always the case.

The yumrepo resource appears to build it's knowledge of the state of the 
machine at invocation. It disregards the fact that the state of the machine can 
change as the puppet catalog for the node is evaluated on the node. For 
example, requiring a Package resource changes the state of the machine; it 
places files on disk.

This is relevant to what others have said in other tickets regarding what 
appears to be the caching of the existing yum configuration.

When the state of the machine changes (ie, a new repo file is put down by a 
Package resource that is explicitly defined as a dependency of the Yumrepo 
resource) the Yumrepo resource will step on the dependency, thereby making this 
"dependency" irrelevant.

The Yumrepo resource is behaving incorrectly.
----------------------------------------
Bug #1238: strange yumrepo/package interaction
https://projects.puppetlabs.com/issues/1238

Author: BMDan -
Status: Accepted
Priority: Normal
Assignee: David  Lutterkort
Category: yumrepo
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Yumrepo appears to be checking file existence before allowing the package 
command to complete, meaning that it creates a file containing only "[remi]" 
and "enabled=1", overwriting the file that the RPM installed.

Manifests, additional debug output, etc., available upon request.  Just tell me 
what you need to know.  Workarounds especially welcomed.  Puppet v. 0.24.4, 
running with --debug --test, on Ruby 1.8.6.114-1, compiled from source with 
default options.

<pre>
debug: //Node[default]/remi_enabled/Yumrepo[remi]/require: requires 
Package[remi-release-5-4.el5.remi]
</pre>
...
<pre>
debug: Puppet::Type::Package::ProviderRpm: Not suitable: false value
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm -q 
remi-release-5-4.el5.remi --nosignature --nodigest --qf %{NAME} 
%|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}'
debug: /Package[remi-release-5-4.el5.remi]: Changing ensure
debug: /Package[remi-release-5-4.el5.remi]: 1 change(s)
debug: Puppet::Type::Package::ProviderRpm: Executing '/bin/rpm -i --oldpackage 
http://rpms.famillecollet.com/el5.x86_64/remi-release-5-4.el5.remi.noarch.rpm'
notice: /Package[remi-release-5-4.el5.remi]/ensure: created
info: create new repo remi in file /etc/yum.repos.d/remi.repo
debug: //Node[default]/remi_enabled/Yumrepo[remi]: Changing enabled
debug: //Node[default]/remi_enabled/Yumrepo[remi]: 1 change(s)
notice: //Node[default]/remi_enabled/Yumrepo[remi]/enabled: defined 'enabled' 
as '1'
info: Filebucket[/var/lib/puppet/clientbucket]: Adding 
/etc/yum.repos.d/remi.repo(18f7009978e772c9c646b9410fa3a8b6)
</pre>


-- 
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 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