Define skills
Chef 360 Platform installs the following skills in the default skill assembly:
- Chef Infra Client Interpreter: Executes Infra Client actions through a Courier job
- Courier Runner: Interprets Courier job definitions sent by the Courier Dispatcher and executes them on the node
- Gohai: Collects node attributes and attributes collected by the Node Management Agent
- InSpec Interpreter: Executes Chef InSpec audits
- Restart Interpreter: Reboots nodes and continues with subsequent steps through a Courier job
- Shell Interpreter: Executes OS commands through a Courier job
Role requirements
To define skills, you must use a profile with the node-manager
role.
Define skills
To manage skills on Chef 360 Platform, you must add the skill’s definition to the Node Management skill definitions.
The definition includes:
- the skill’s name
- Habitat package (canister) information
- whether it runs as a Habitat service
- skill definition templates needed to configure the skill on a node
Define the Courier Runner skill
To define Courier Runner as a service skill in Chef 360 Platform, follow these steps:
Create a JSON file containing the skill definition for Courier Runner:
{ "name": "courier-runner", "canister": { "name": "courier-runner", "origin": "chef-platform", "service": true }, "configurationTemplates": [ { "content": "W2xvZ10KZGlyID0gInt7LnNldHRpbmdzLmxvZ19kaXJ9fSIKZm9ybWF0ID0gInt7LnNldHRpbmdzLmxvZ19mb3JtYXR9fSIKbGV2ZWwgPSAie3suc2V0dGluZ3MubG9nX2xldmVsfX0iCm91dHB1dCA9ICJ7ey5zZXR0aW5ncy5sb2dfb3V0cHV0fX0iCm1heF9zaXplID0gInt7LnNldHRpbmdzLm1heF9zaXplfX0iCnJldGVudGlvbl9kYXlzID0ge3suc2V0dGluZ3MucmV0ZW50aW9uX2RheXN9fQppc19sb2dfcmV0ZW50aW9uID0ge3suc2V0dGluZ3MuaXNfbG9nX3JldGVudGlvbn19Cltub2RlXQpub2RlX2lkID0gInt7LmFnZW50Lm5vZGVJZH19IgoKe3tpZiBpbmRleCAuc2V0dGluZ3MgInNoZWxsX2ludGVycHJldGVyIn19CltbaW50ZXJwcmV0ZXJzXV0KbmFtZSA9ICJ7ey5zZXR0aW5ncy5zaGVsbF9pbnRlcnByZXRlcn19Igp7e2VuZH19Cnt7aWYgaW5kZXggLnNldHRpbmdzICJyZXN0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bGwucGxhdGZvcm1DcmVkZW50aWFsc1BhdGh9fSIKcm9vdF9jYV9wYXRoID0gInt7LmFnZW50LnJvb3RDYVBhdGh9fSIKaW5zZWN1cmUgPSAie3suYWdlbnQuaW5zZWN1cmV9fSIKCltxdWV1ZV0KcHJvdmlkZXIgPSAw", "fileName": "user.toml", "filePath": "/hab/user/courier-runner/config", "name": "courier-runner-template", "windowsFilePath": "c:\\hab\\user\\courier-runner\\config" } ] }
To register the skill as a service, set the
canister.service
attribute totrue
and ensure thename
andcanister.name
fields are identical.Create the skill:
chef-node-management-cli management skill create-skill \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Define the Gohai skill
To define the Gohai skill settings, follow these steps:
Create a JSON file with the Gohai skill’s definition:
{ "name": "chef-gohai", "canister": { "origin": "chef-platform", "name": "chef-gohai", "service": true }, "configurationTemplates": [ { "content": "W2dvaGFpXQpub2RlX2lkID0gInt7LmFnZW50Lm5vZGVJZH19Igpub2RlX3JvbGVfbGlua19pZCA9ICJ7ey5za2lsbC5ub2RlUm9sZUxpbmtJZH19IgpwbGF0Zm9ybV9jcmVkZW50aWFsc19wYXRoID0gInt7LnNraWxsLnBsYXRmb3JtQ3JlZGVudGlhbHNQYXRofX0iCmluc2VjdXJlID0ge3suYWdlbnQuaW5zZWN1cmV9fQpyb290X2NhX3BhdGggPSAie3suYWdlbnQucm9vdENhUGF0aH19IgoKW3NlcnZlcl0KcG9sbF9pbnRlcnZhbCA9ICJ7ey5zZXR0aW5ncy5wb2xsX2ludGVydmFsfX0iCgpbYXBpXQp0ZW5hbnRfZnFkbnMgPSAie3suYWdlbnQudGVuYW50RnFkbnN9fSIKCltsb2dnZXJdCmxvZ19sZXZlbCA9ICJ7ey5zZXR0aW5ncy5sb2dfbGV2ZWx9fSIKbG9nX3RvX3N0ZG91dCA9IHt7LnNldHRpbmdzLmxvZ190b19zdGRvdXR9fQpsb2dfdG9fZmlsZSA9IHt7LnNldHRpbmdzLmxvZ190b19maWxlfX0KbG9nX2ZpbGVfcGF0aCA9ICJ7ey5zZXR0aW5ncy5sb2dfZmlsZV9wYXRofX0iCm1heF9zaXplPSAie3suc2V0dGluZ3MubWF4X3NpemV9fSIKcmV0ZW50aW9uX2RheXM9IHt7LnNldHRpbmdzLnJldGVudGlvbl9kYXlzfX0KaXNfbG9nX3JldGVudGlvbj0ge3suc2V0dGluZ3MuaXNfbG9nX3JldGVudGlvbn19", "fileName": "user.toml", "filePath": "/hab/user/chef-gohai/config", "name": "default", "windowsFilePath": "c:\\hab\\user\\chef-gohai\\config" } ] }
Update the Gohai skill definition:
chef-node-management-cli management skill modify-skill \ --skillName chef-gohai \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Define the Infra Client Interpreter skill
To define the Infra Client Interpreter skill settings, follow these steps:
Create a JSON file with the Infra Client Interpreter skill’s definition:
{ "name": "chef-client-interpreter", "canister": { "origin": "chef-platform", "name": "chef-client-interpreter", "service": false }, "configurationTemplates": [] }
Update the Infra Client Interpreter skill definition:
chef-node-management-cli management skill modify-skill \ --skillName chef-client-interpreter \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Define the InSpec Interpreter skill
To define the InSpec Interpreter skill settings, follow these steps:
Create a JSON file with the InSpec Interpreter skill’s definition:
{ "name": "inspec-interpreter", "canister": { "origin": "chef-platform", "name": "inspec-interpreter", "service": false }, "configurationTemplates": [] }
Update the InSpec Interpreter skill definition:
chef-node-management-cli management skill modify-skill \ --skillName inspec-interpreter \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Define the Restart Interpreter skill
To define the Restart Interpreter skill settings, follow these steps:
Create a JSON file with the Restart Interpreter skill’s definition:
{ "name": "restart-interpreter", "canister": { "origin": "chef-platform", "name": "restart-interpreter", "service": false }, "configurationTemplates": [] }
Update the Restart Interpreter skill definition:
chef-node-management-cli management skill modify-skill \ --skillName restart-interpreter \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Define the Shell Interpreter skill
To define the Shell Interpreter skill settings, follow these steps:
Create a JSON file with the Shell Interpreter skill’s definition:
{ "name": "shell-interpreter", "canister": { "origin": "chef-platform", "name": "shell-interpreter", "service": false }, "configurationTemplates": [] }
Update the Shell Interpreter skill definition:
chef-node-management-cli management skill modify-skill \ --skillName shell-interpreter \ --body-file <PATH_TO_JSON_FILE> \ --profile <NODE_MANAGER_PROFILE_NAME>
Next steps
After defining skills: