Skip to content

Instantly share code, notes, and snippets.

@ranjib
Last active December 18, 2015 11:59
Show Gist options
  • Save ranjib/5779442 to your computer and use it in GitHub Desktop.
Save ranjib/5779442 to your computer and use it in GitHub Desktop.
Migrating chef-validator client

Grab the validation client in json format from old chef server

knife client show chef-validator -c knife-chef-server-10.rb -Fj > chef-validator.json

Upload the validation client to new chef server, delete the existing validation client from new chef server first, as update(PUT) is not allowed, only create(POST) is allowed

knife client delete chef-validator -y -c knife-chef-server-11.rb
knife raw clients -m put -c knife-chef-server-11.rb -i chef-validator.json

Compare the validation clients

knife client show chef-validator -c knife-chef-server-10.rb 
knife client show chef-validator -c knife-chef-server-11.rb 

Test the validation client in a node against the new chef server, throws following error

================================================================================
Chef encountered an error attempting to create the client "ci02"
================================================================================


Authorization Error:
--------------------
Your validation client is not authorized to create the client for this node (HTTP 403).

Possible Causes:
----------------
* There may already be a client named "ci02"
* Your validation client (chef-validator) may have misconfigured authorization permissions.
@danielsdeleo
Copy link

"validator-ness" is a settable property of a client in Chef 11, but not in Chef 10. See the "step 4: massage the data" section of the upgrade post: http://www.opscode.com/blog/2013/03/12/5106/

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