Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPEL managed_repo broken #53

Closed
jhg03a opened this issue Jun 14, 2017 · 2 comments
Closed

EPEL managed_repo broken #53

jhg03a opened this issue Jun 14, 2017 · 2 comments

Comments

@jhg03a
Copy link

jhg03a commented Jun 14, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.1
  • Ruby: bundled
  • Distribution: CentOS 7
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

Hiera:

yum::managed_repos:
    - epel

Puppet Profile:

  include ::yum

What are you seeing

Instead of a a file being created at /etc/repos.d/epel.repo, it is created at "/etc/yum.repos.d/Extra Packages for Enterprise Linux 7 - $basearch.repo".

At that point if you try to add a package from epel, such as glances, the yum command will fail. When trying to run a manual yum install to verify the package exists, you get the error below.

What behaviour did you expect instead

A functional package install with yum from epel. It should have payed attention to the target parameter to Yumrepo.

Output log

[jonathan.gray@puppet yum.repos.d]$ sudo yum repolist
Loaded plugins: fastestmirror, versionlock
Bad id for repo: Extra Packages for Enterprise Linux 7 - x86_64, byte =   5
Loading mirror speeds from cached hostfile
 * base: dist1.800hosting.com
 * updates: www.gtlib.gatech.edu
repo id                                                                              repo name                                                                                             status
base/7/x86_64                                                                        CentOS-7 - Base                                                                                       9,363
puppet_enterprise                                                                    PuppetLabs PE Packages 7 - x86_64                                                                        24
updates/7/x86_64                                                                     CentOS-7 - Updates                                                                                    1,857
repolist: 11,244
[jonathan.gray@puppet yum.repos.d]$ sudo vim
CentOS-Base.repo                                        centos-media.repo                                       Extra Packages for Enterprise Linux 7 - $basearch.repo
CentOS-CR.repo                                          CentOS-Media.repo                                       puppet_enterprise.repo
CentOS-Debuginfo.repo                                   CentOS-Sources.repo
CentOS-fasttrack.repo                                   CentOS-Vault.repo

Any additional information you'd like to impart

It looks like this isn't the module's fault but rather the core YumRepo Resource Type. In the meantime it can be worked around by treating epel like a custom repo again. The gotcha there is you have to give it a new title suffix such as epel_workaround so it doesn't pick up on the broken definitions inside the module. This also has the limitation that only a single repo definition can be present inside the file.

@jhg03a
Copy link
Author

jhg03a commented Jun 14, 2017

It looks like @bastelfreak ran into this a while ago and worked around it by just treating .repo files as the ini files they really are and bypassing the Yumrepo resource type all together.

crispygoth added a commit to crispygoth/puppet-yum that referenced this issue Aug 11, 2017
The provided settings for the EPEL repos were using the "name" key for
the repository description, but this maps to the Puppet namevar, which
is the repo ID (aka the name of the file in /etc/yum.repos.d). They
should instead be using the key "descr" which is what maps to the "name"
value in the repo settings.

Fixes issue voxpupuli#53
crispygoth added a commit to crispygoth/puppet-yum that referenced this issue Aug 11, 2017
The provided settings for the EPEL repos were using the "name" key for
the repository description, but this maps to the Puppet namevar, which
is the repo ID (aka the name of the file in /etc/yum.repos.d). They
should instead be using the key "descr" which is what maps to the "name"
value in the repo settings.

Fixes issue voxpupuli#53
@crispygoth
Copy link

crispygoth commented Aug 11, 2017

I think the target thing is a bit of a red herring. The issue is that the bundled repo config is using the name attribute for the repo description when it should be using the descr attribute instead.

I've fixed this in my fork although now I'm having issues with the gpg key. It's trying to read the GPG key from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-%{facts.os.release.major} (i.e. /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 on my CentOS 6 system) but this file doesn't exist. Does anyone know how this is intended to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants