We shall be using the knife-essentials plugin to upgrade from Chef 10 to Chef 11.
To upgrade, you need a live Chef 10 and Chef 11 server, and a knife workstation that can hit them both, loaded with the latest knife-essentials.
1. To install Chef 11, follow instructions here.
Note: If we are going to install Chef 11 on same server as that of Chef 10, in our case we had to modify few configurations in Chef 11 which are listed below:
2. To install the latest knife-essentials:
gem install knife-essentials
First, we’ll set up knife.rb file on the workstation to point at the old Chef 10 server
~/transfer
..chef/knife-chef10.rb
file in the transfer directory that points at the Chef 10 server (replacing the server URL with your server). You must use an admin client for this; we chose chef-webui
because it’s present by default. Any admin client will do; replace it in the appropriate places. The file should look like this:
transfer_repo = File.expand_path('..', File.dirname(__FILE__)) chef_server_url "http://chef-10.nclouds.com:4000" node_name 'chef-webui' client_key "#{transfer_repo}/.chef/chef-webui.pem" repo_mode 'everything' versioned_cookbooks true chef_repo_path transfer_repo cookbook_path nil
/etc/chef/webui.pem
on the server):
cp <your webui.pem> .chef/chef-webui.pem
You can check if this worked by running knife list /clients
. This will show you a list of all the clients, including clients/chef-webui.json
and clients/chef-validator.json
.
Download everything from the Chef 10 server
knife download -c .chef/knife-chef10.rb /
All chef data nodes, roles, environments, cookbooks… in your Chef server is now in the transfer directory, ready to be uploaded to chef 11.
.chef/knife.rb
file in the transfer directory that points at the new server (replacing the server URL with your server):
transfer_repo = File.expand_path('..', File.dirname(__FILE__)) chef_server_url "https://chef-11.example.com" node_name 'admin' client_key "#{transfer_repo}/.chef/admin.pem" repo_mode 'everything' versioned_cookbooks true chef_repo_path transfer_repo cookbook_path nil
admin.pem
in the transfer directory.cp <your admin PEM> .chef/admin.pem
You can check if this works by running knife list /users
. This should print users/admin.json
.
knife upload /
After this procedure, you shall update Chef client by editing this File “/etc/chef/client.rb” on each node to point to new Chef 11 server “https://chef-11.example.com” to start using it.
Top takeaways: AWS Managed Microsoft AD and Microsoft Active Directory
2022-12-05 15:25:16