-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Node/client cleanup never succeeds #1295
Comments
Same problem for us, also it appears as though the knife command is not using sudo (is this correct?) |
I think we need to mirror more of the |
The knife command runs on the same machine as packer. I finally got it working by adding ~/.chef/knife.rb with all the right config for the server. I am going to make sure my PR contains some new language for the docs. Even if knife commands were executed remotely sudo should not be required. Also see #1520 |
The current Chef-client provisioner implementation requires that a Chef user private key with admin privileges be accessible from the host running Packer (i.e., not the build target). But in fact, this is not required, and leads to unnecessary problems, especially in CI environments where sharing a user's private key may not be desired. Instead, I'd propose that the provisioner run knife inside the build environment with the following arguments:
Notes:
|
Here is what we're doing now, since the Chef-client provisioner is still not fully-baked:
|
I am running into this problem as well, so far I have not found a viable solution when using chef-client. I've searched high and low to no avail, so i am here as a humble user who desperately needs your help in having a solution in this provisioner. Update: I would bet that the current logic to use the host OS was a purposeful decision however there may be value in adding code to support both routines and expose a configuration option to the user. |
provisioner/chef-client: run cleanup on node [GH-1295]
This worked for me. |
+1 here for doing the cleanup inside the build environment. In my environment I have several Chef orgs with different parameters, and I don't want my default Knife config to be the same as the configuration I am using for building AWS AMIs. The other issue (not sure if opened elsewhere), is this cleanup fails on Windows machines running Packer, it assumes a Linux host with the Sudo command, which always fails on Windows: ==> amazon-ebs: Cleaning up chef node... Thanks. |
chef-client run succeeds, but running the knife node/client delete -y always fails with output:
amazon-instance: Chef Client finished, 0/0 resources updated in 6.707980715 seconds
==> amazon-instance: Cleaning up chef node...
amazon-instance: Response: node 'packer-build-api' not found
amazon-instance:
==> amazon-instance: Terminating the source AWS instance...
==> amazon-instance: Deleting temporary security group...
Build 'amazon-instance' errored: Error cleaning up chef node: exit status 100
Source AMI OS: ubuntu 12.04
packer.json:
Is packer using the -c option for knife when it tries to clean up?
The text was updated successfully, but these errors were encountered: