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

Chef Generate ignores config.rb options placed in credentials file #190

Open
qubitrenegade opened this issue Sep 9, 2021 · 0 comments
Open
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.

Comments

@qubitrenegade
Copy link

Version:

Chef Workstation version: 21.8.555
Chef Infra Client version: 17.3.48
Chef InSpec version: 4.38.9
Chef CLI version: 5.4.1
Chef Habitat version: 1.6.351
Test Kitchen version: 3.0.0
Cookstyle version: 7.15.4

Environment:

Confirmed on Ubuntu and Fedora

Scenario:

The docs seem to imply the credentials file is the new way of doing things: https://docs.chef.io/workstation/knife_setup

"Previous Chef Infra setups recommended setting up knife with a config.rb file."

The docs also seem to suggest that any config.rb values are valid in the credentials file (emphasis mine):

"Set up knife profiles by adding them to the .chef/credentials file in your home directory on your workstation. The credentials file is TOML formatted. Each profile is listed as a separate ‘table’ name of your choice, and is followed by key = value pairs. The keys correspond to any setting permitted in the config.rb file."

However, this does not seem to work...

Steps to Reproduce:

Create ~/.chef/credentials file

[default]
client_name     = 'foo'
client_key      = '/home/foo/.chef/foo.pem'
chef_server_url = 'https://foo.ec2.internal/organizations/myorg'
cookbook_email  = 'foo [at] gmail.com'
cookbook_license = 'apachev2'
cookbook_copyright = 'foo'

Generate cookbook

chef generate cookbook foo

Find default info in metadata:

$ grep maintainerffoo/metadata.rb 
maintainer 'The Authors'
maintainer_email '[email protected]'
$ grep license foo/metadata.rb 
license 'All Rights Reserved'

Expected Result:

license, maintainer, and maintainer_email should be replaced.

Actual Result:

Default information still in place.

@qubitrenegade qubitrenegade added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Sep 9, 2021
@vkarve-chef vkarve-chef added Triage: Confirmed Indicates and issue has been confirmed as described. and removed Status: Untriaged An issue that has yet to be triaged. labels Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

2 participants