Issue #16623 has been updated by eric sorenson.

Status changed from Unreviewed to Needs More Information
Assignee set to Tim Yim

Tim when puppet writes out the repo file into /etc/yum.repos.d/, does it have 
the variable inline?

Can you try the code in the pull request referenced from #16790 to see if it 
resolves your issue?
----------------------------------------
Bug #16623: yum helper fails when using a custom yum plugin with custom 
variables
https://projects.puppetlabs.com/issues/16623#change-74735

Author: Tim Yim
Status: Needs More Information
Priority: Normal
Assignee: Tim Yim
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.

Reply via email to