Puppet: System Administration Automated

Support

Ticket #1238 (new defect)

Opened 6 months ago

Last modified 6 months ago

strange yumrepo/package interaction

Reported by: BMDan Assigned to: lutter
Priority: normal Milestone:
Component: yumrepo Version: 0.24.4
Severity: normal Keywords:
Cc: Triage Stage: Needs design decision
Attached Patches: None Complexity: Unknown

Description

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.

debug: //Node[default]/remi_enabled/Yumrepo[remi]/require: requires Package[remi-release-5-4.el5.remi]

...

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)

Attachments

remi_enabled.pp.txt (113 bytes) - added by BMDan on 05/22/08 16:07:45.
yumrepo
remi_x86_64.pp.txt (253 bytes) - added by BMDan on 05/22/08 16:08:03.
Package containing the repo

Change History

05/21/08 23:05:21 changed by lutter

The manifest, in particular the yumrepo statement would be very helpful.

From the log, it looks like the problem is that the yumrepo provider looks for a file 'remi.repo' very early on in the puppet run and notices that the file does not exist (that check is made before _any_ resources are actually run IIRC, from a class method in the yumrepo provider).

The fact that an rpm install later creates that file is completely lost on the yumrepo provider.

One workaround would be to specify everything from remi.repo in your yumrepo statement.

05/22/08 08:14:24 changed by jamtur01

  • stage changed from Unreviewed to Needs more info.

05/22/08 16:07:45 changed by BMDan

  • attachment remi_enabled.pp.txt added.

yumrepo

05/22/08 16:08:03 changed by BMDan

  • attachment remi_x86_64.pp.txt added.

Package containing the repo

05/22/08 16:42:22 changed by BMDan

I've attached both manifests associated with the problem.

05/23/08 00:32:23 changed by lutter

The issue is indeed the order in which things happen. The yumrepo provider prefetches all files in /etc/yum.repos.d _before_ the RPM is installed, and so thinks that the remi.repo does not exist yet. The yumrepo provider assumes that it is the only one modifying files in /etc/yum.repos.d during a puppet run.

Your best bet around this problem is to expand your yumrepo statement to specify the whole remi.repo file, and not install remi-release at all.

05/23/08 15:20:23 changed by BMDan

  • stage changed from Needs more info to Needs design decision.

Can we agree that this is, however, a bug? At the very least, it breaks the principle of least astonishment. Setting triage to "needs design decision"....