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

How to make sure the chef-repo contents (roles, ...) are on the started chef-zero instance automatically #52

Closed
daften opened this issue Aug 18, 2015 · 3 comments

Comments

@daften
Copy link
Contributor

daften commented Aug 18, 2015

When I start knife zero (e.g. to bootstrap an empty vagrant box or a digital ocean machine), the chef run complains that nothing can be found. When I start the bootstrap and let it hang when it asks for a password for ssh and check the chef-zero instance, the server is empty. Something must be wrong in my config it seems. However, I followed all the documentation I could found strictly.

My knife.rb file contents

cookbook_path    [File.expand_path('../../cookbooks' , __FILE__), File.expand_path('../../site-cookbooks' , __FILE__)]
node_path        File.expand_path('../../nodes' , __FILE__)
role_path        File.expand_path('../../roles' , __FILE__)
environment_path File.expand_path('../../environments' , __FILE__)
data_bag_path    File.expand_path('../../data_bags' , __FILE__)
encrypted_data_bag_secret "encrypted_data_bag_secret"
local_mode       true

knife[:bootstrap_version] = "12.4.1"
knife[:berkshelf_path] = "cookbooks"

And my roles are in json format.

@sawanoboly
Copy link
Member

Thank you for using.

We can replace configuration from below..

cookbook_path    [File.expand_path('../../cookbooks' , __FILE__), File.expand_path('../../site-cookbooks' , __FILE__)]
node_path        File.expand_path('../../nodes' , __FILE__)
role_path        File.expand_path('../../roles' , __FILE__)
environment_path File.expand_path('../../environments' , __FILE__)
data_bag_path    File.expand_path('../../data_bags' , __FILE__)

TO

chef_repo_path File.expand_path('../../' , __FILE__)
cookbook_path    [File.expand_path('../../cookbooks' , __FILE__), File.expand_path('../../site-cookbooks' , __FILE__)]

Then, could you try knife serve to check your chef-zero instance instead of chef-zero command.

The chef-zero command always launches with empty resources. Because storage setting is set to on memory by default.

knife serve subcommand launches chef-zero instance with local file system which is set by configurations in knife.rb.

@daften
Copy link
Contributor Author

daften commented Aug 19, 2015

Hi,

This fixes it indeed, thanks!
I'll try to put this in documentation via a PR later today, because I can't find this in docs anywhere atm :)

@daften
Copy link
Contributor Author

daften commented Aug 20, 2015

PR in #54

sawanoboly added a commit that referenced this issue Aug 20, 2015
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