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

Lay down berkshelf config.json for publish #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ndobson
Copy link

@ndobson ndobson commented May 30, 2015

Fixes #6

@tduffield
Copy link
Contributor

Thanks @ndobson for the PR. However this change hard codes a path that is specific to a Delivery Builder (/var/opt/delivery/workspace). Users can (and do) run delivery-truck outside of a Delivery Server (via jenkins) and would not have this file path. Because the Jenkins use case is a first class citizen for delivery-truck we'll need to not hard-code paths like these.

@ndobson
Copy link
Author

ndobson commented May 31, 2015

Thanks @tduffield for the feedback! I thought it was acceptable because on line 25 of the publish recipe there is a hard coded config.rb that all knife commands are run with. But if that's not the case is there another approach that you see? I was also thinking something like this (summarizing):

Call Chef_Delivery::ClientHelper.enter_client_mode_as_delivery
Reference Chef::Config[:client_key] and Chef::Config[:node_name] for the contents of the file
Call Chef_Delivery::ClientHelper.leave_client_mode_as_delivery

Another approach could be to simply wrap the berks config.json file resource in an if block like so:
if File.exists?(File.expand_path(File.join('/var/opt/delivery/workspace/.chef', 'delivery.pem')))

Thoughts?

@tduffield
Copy link
Contributor

I think the right answer is to create the file referencing the key and node name like you have above.

@chef-supermarket
Copy link

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.

Non-GitHub Verified Committers

There are 1 commit author(s) whose commits are authored by a non-GitHub verified email address. Chef will have to manually verify that they are authorized to contribute.

Please sign the CLA here.

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

Successfully merging this pull request may close these issues.

Berks vendor in publish phase causes permission denied on client key when pulling from a chef server
3 participants