Issue #16623 has been updated by Tim Yim.
Forgot to add this to the main description:
This will become an even more widespread issue with el6 and any other distros
that use yum >= 3.2.28 due to a new feature of loading custom variables at
runtime.
>From man yum.conf:
As of 3.2.28, any file in /etc/yum/vars is turned into a variable named
after the filename (or overrides any of the above variables).
Note that no warnings/errors are given if the files are unreadable, so
creating files that only root can read may be confusing for users.
Also note that only the first line will be read and all new line characters
are removed, as a convenience. However, no other checking is performed on the
data. This means it is possible to have bad character data in any value.
----------------------------------------
Bug #16623: yum helper fails when using a custom yum plugin with custom
variables
https://projects.puppetlabs.com/issues/16623#change-71973
Author: Tim Yim
Status: Unreviewed
Priority: Normal
Assignee:
Category: yumrepo
Target version: 2.7.x
Affected Puppet version: 2.7.9
Keywords: yumrepo yum
Branch:
We have a custom yum plugin that provides a custom variable for use in our
.repo files and the Puppet yum helper does not function correctly with custom
variables.
First, we ensure our yum plugin is installed on all machines:
package {
'SNC-2-1-1-1:.:.:snc-yum':
name => 'snc-yum',
ensure => installed
}
Then, we set up our repositories.
sncyumrepo {
'SNC-2-1-3-1:.:.:yumrepo-base':
name => 'base',
alias => 'base',
descr => 'CentOS Base Repository',
baseurl => 'http://repo/centos/$sncversion/os/$basearch/',
enabled => 1,
gpgcheck => 1,
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-$releasever',
require => File['yumparentdir']
}
Notice the baseurl contains our custom variable: $sncversion. This is the
variable that is provided by the yum plugin.
This will write our the base.repo file WITH that variable in the final output.
The variable is the replaced by yum just like the built-in yum variable
$releasever.
Then, we attempt to use the base.repo and it fails!
package {
'SNC-2-1-1-1:.:.:any-package':
name => 'any-package',
ensure => installed
}
Every call to 'package' that uses the base.repo will fail and also cause the
yum metadata to be in an inconsistent state. We are forced to run a 'yum clean
all'.
We believe the Puppet yum helper is not properly using the yum environment and
is therefore unable to replace the value of $sncversion when trying to install
a package from the base.repo.
For your convenience, I have attached an RPM of our yum plugin. It is very,
very basic and is safe to install on el5 and el6. I've included the .src RPM as
well in case you would like to review the plugin code.
--
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.