Skill assembly
A skill assembly defines a set of skills that are installed or removed from a set of nodes.
Create a skill assembly
To create a skill assembly, follow these steps:
Create a JSON file that defines the added skills.
{ "name": "<SKILL_ASSEMBLY_NAME>", "skills": [ { "action": "add", "skill": { "channel": "stable", "name": "courier-runner", "value": ["<VERSION>"] } }, { "action": "add", "skill": { "channel": "stable", "name": "chef-gohai", "value": ["<VERSION>"] } }, { "action": "add", "skill": { "channel": "stable", "name": "shell-interpreter", "value": ["<VERSION>"] } }, { "action": "add", "skill": { "channel": "stable", "name": "restart-interpreter", "value": ["<VERSION>"] } }, { "action": "add", "skill": { "channel": "stable", "name": "chef-client-interpreter", "value": ["<VERSION>"] } } ] }
Replace
<VERSION>
with the version of each skill supported by the Chef 360 Platform version you’re running. See the release notes for details.Create the skill assembly:
chef-node-management-cli management assembly create-assembly --body-file <PATH_TO_JSON_FILE>
The response is similar to the following:
{ "item": { "skillAssemblyId": "e2e66c8a-79ff-4bdc-a4cd-739c3f02f9e9" } }
Update a skill assembly
You can add or remove skills from nodes by updating an existing skill assembly.
Add skills
Use the
add
action to add a skill:{ "name": "<SKILL_ASSEMBLY_NAME>", "skills": [ { "action": "add", "skill": { "channel": "stable", "name": "<SKILL_NAME>", "value": ["<DESIRED_VERSION>"] } } ] }
Replace:
<SKILL_ASSEMBLY_NAME>
with the skill assembly name<SKILL_NAME>
with the name of the skill, for exampleshell-interpreter
<DESIRED_VERSION>
with the version you want to install
Update the skill assembly:
chef-node-management-cli management assembly update-assembly --skillAssemblyId <SKILL_ASSEMBLY_ID> --body-file <PATH_TO_JSON_FILE>
Remove skills
Use the remove
action to define skills that are removed. You can use logical operators to remove a range of skills:
Use an operator like
<
,>
, or=
to remove a skill version or a range of versions:{ "name": "<SKILL_ASSEMBLY_NAME>", "skills": [ { "action": "remove", "skill": { "channel": "stable", "name": "<SKILL_NAME>", "value": ["<OPERATOR> <VERSION>"] } } ] }
Replace:
<SKILL_ASSEMBLY_NAME>
with the skill assembly name<SKILL_NAME>
with the name of the skill, for exampleshell-interpreter
<OPERATOR>
with a logical operator, for example<
,>
, or=
<VERSION>
with the version or versions you want to remove
Update the skill assembly:
chef-node-management-cli management assembly update-assembly --skillAssemblyId <SKILL_ASSEMBLY_ID> --body-file <PATH_TO_JSON_FILE>
Example
In this skill assembly example, all Restart Interpreter skills less than version 0.1.2 are removed, Shell Interpreter version 0.1.5 is removed, and the Courier Runner and Chef Gohai skills are added.
{
"name": "skill-assembly-name",
"skills": [
{
"action": "remove",
"skill": {
"channel": "stable",
"name": "shell-interpreter",
"value": ["= 0.1.5"]
}
},
{
"action": "remove",
"skill": {
"channel": "stable",
"name": "restart-interpreter",
"value": ["< 0.1.2"]
}
},
{
"action": "add",
"skill": {
"channel": "stable",
"name": "courier-runner",
"value": ["1.3.1"]
}
},
{
"action": "add",
"skill": {
"channel": "stable",
"name": "chef-gohai",
"value": ["0.3.1"]
}
}
]
}
Troubleshooting
Run the following command to verify that the skill assembly was created or updated:
chef-node-management-cli management assembly find-one-assembly --skillAssemblyId <SKILL_ASSEMBLY_ID>