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

Is there a good way to detect if cookbook is being run using chef-zero? #63

Closed
spajus opened this issue Apr 10, 2014 · 3 comments
Closed

Comments

@spajus
Copy link

spajus commented Apr 10, 2014

This would be useful for switching test credentials, etc. A piece of documentation about it in README.md would be nice.

@lamont-granquist
Copy link
Contributor

How does test-kitchen not already cover this use case?

@jkeiser
Copy link
Contributor

jkeiser commented Apr 10, 2014

Technically you can probably look for Chef::Config.local_mode, if you are doing chef-client -z. But I would not suggest this: we've seen if Chef::Config.solo exceptions strewn about through cookbooks, and what it really means is that when you test your cookbook, you aren't testing the cookbook that will run in production. I would use node attributes for your cookbooks to tell it credentials and such.

@spajus
Copy link
Author

spajus commented Apr 11, 2014

Thanks for the answer. I want to use these exceptions only for not having to use encrypted data bags when running test-kitchen - didn't find an easy way to distribute required .pem files into VMs during test run.

@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants