22 lines
733 B
Markdown
22 lines
733 B
Markdown
- Machine registration
|
|
1. Create `client.rb` and `validation.pem`
|
|
- The former defines variables Chef needs to set up a new machine and the latter is the `chef-validator` private key
|
|
2. `apt update && apt install -y chef`
|
|
3. `chef-client`
|
|
4. `ls /etc/chef`
|
|
- Configure the `knife` utility
|
|
- `~/.chef/knife.rb`
|
|
```Ruby
|
|
node_name 'aws-node-78ec.eu-west-1.compute.internal'
|
|
client_key '/etc/chef/client.pem'
|
|
chef_server_url 'https://chef.mxrads.net/organizations/mxrads'
|
|
knife[:editor] = '/usr/bin/vim'
|
|
```
|
|
|
|
- Explore Chef cookbooks
|
|
- List
|
|
- `knife cookbooks list`
|
|
- Display cookbook version history
|
|
- `knife cookbooks show <cookbook_name>`
|
|
- Display specific cookbook
|
|
- `knife cookbooks show <cookbook_name> <version>` |