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

gpgkey cannot specify more than one of content, source #204

Closed
patemery opened this issue May 27, 2021 · 1 comment
Closed

gpgkey cannot specify more than one of content, source #204

patemery opened this issue May 27, 2021 · 1 comment

Comments

@patemery
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 2019.8.5
  • Ruby: unsure
  • Distribution: Puppet Enterprise
  • Module version: 4.3.0

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

puppet apply --modulepath /home/pat/modules -e 'class { "yum": manage_os_default_repos => false, }'

with the following added locally into the "yum" module. I understand that that is not the right way to do it. I only did it to create the smallest test case I could with the least amount of work.

I added the following to yum/data/common.yaml

yum::gpgkeys:
  /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7:
    source: puppet:///modules/yum/RPM-GPG-KEY-EPEL-7
yum::managed_repos:
  - 'local_epel'
yum::repos:
  local_epel:
    ensure: 'present'
    descr: 'EPEL for RHEL7'
    baseurl: 'http://reposerver.vanguard.com/epel7/'
    enabled: true
    gpgcheck: true
    gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7'

I created a "files" dir in "yum" module and I added the gpg key file from EPEL to yum/files directory

What are you seeing

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, You cannot specify more than one of content, source (file: /export/home/nt018238/puppet/dev/modules/yum/manifests/gpgkey.pp, line: 50, column: 18) (file: /export/home/nt018238/puppet/dev/modules/yum/manifests/init.pp, line: 140) on node xyz.vanguard.com

What behaviour did you expect instead

I expected

  1. the file /etc/yum.repos.d/local_epel.repo to be created with content enabling gpg key and pointing to file in /etc/pki/rpm-gpg
  2. the file /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 to be created from files dir within module
  3. rpm --import to run for the file created in /etc/pki/rpm-gpg

Output log

See "What are you seeing above"

Any additional information you'd like to impart

I feel as though I have crafted my yaml correctly to accomplish my goal following the examples in the README. What have I done wrong to cause this compilation/evaluation error?

Sorry if I am using the "issue tracker" here inappropriately. Wasn't sure if this was an acceptable use

First time posting an "issue" on github. I wanted to assign the "question" label to this "issue". I can't seem to do that. Are labels only applied by the project owners?

@patemery
Copy link
Author

I figured out what I was doing wrong. Because /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-* exists in the module data, the merge of my hieradata, which specified "source", was duplicating data provided by the module data causing the error. I simply needed to remove the "source" line from my hieradata. Sorry for wasting anyone's time with this question/issue

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

1 participant