Skip to main content

Skill assembly

A skill assembly defines a set of skills that Chef 360 Platform installs or removes from the nodes enrolled with an organization.

If you create a new organization, you can accept the default skill assembly or you can define a custom skill assembly.

Role requirements

To create or manage a skill assembly, you must use a profile with the node-manager role.

Default skill assembly

The default skill assembly is called sample-skill-assembly and includes the following skills:

  • Chef Infra Client interpreter skill
  • Courier Runner skill
  • Gohai skill
  • Inspec interpreter skill
  • Restart interpreter skill
  • Shell interpreter skill

sample-skill-assembly includes the latest versions of all skills:

  • Default skill assembly
    {
      "name": "sample-skill-assembly",
      "skills": [
        {
          "action": "add",
          "skill": {
            "name": "courier-runner",
            "channel": "stable",
            "value": ["1.4.7"]
          }
        },
        {
          "action": "add",
          "skill": {
            "channel": "stable",
            "name": "chef-gohai",
            "value": ["1.2.4"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "shell-interpreter",
            "channel": "stable",
            "value": ["1.0.5"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "inspec-interpreter",
            "channel": "stable",
            "value": ["1.0.7"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "restart-interpreter",
            "channel": "stable",
            "value": ["1.0.4"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "chef-client-interpreter",
            "channel": "stable",
            "value": ["1.0.6"]
          }
        }
      ]
    }
    

Create a new skill assembly

To create a skill assembly, follow these steps:

  1. Create a JSON file that defines the skills you want to add to a skill assembly:

    {
      "name": "<SKILL_ASSEMBLY_NAME>",
      "skills": [
        {
          "action": "add",
          "skill": {
            "channel": "stable",
            "name": "<SKILL_NAME>",
            "value": ["<SKILL_VERSION>"]
          }
        },
        {
          "action": "add",
          "skill": {
            "channel": "stable",
            "name": "<SKILL_NAME>",
            "value": ["<SKILL_VERSION>"]
          }
        }
      ]
    }
    

    Replace:

    • <SKILL_ASSEMBLY_NAME> with a name for the skill assembly.
    • <SKILL_NAME> with the name of the skill you are installing.
    • <SKILL_VERSION> with the version of the skill you are installing. See the release notes for details for the skill version supported by the version of Chef 360 Platform that you’re running.
  2. Create the skill assembly:

    chef-node-management-cli management assembly create-assembly --body-file <PATH_TO_JSON_FILE> --profile <NODE_MANAGER_PROFILE_NAME>
    

    The response is similar to the following:

    {
    "item": {
        "skillAssemblyId": "e2e66c8a-79ff-4bdc-a4cd-739c3f02f9e9"
      }
    }
    

    Save the skill assembly ID, you’ll use it to create a node cohort.

Example

This example defines a skill assembly for several required skills in Chef 360 Platform.

  1. Create a file named skill-assembly.json and paste in the following skill assembly definition:

    {
      "name": "sample-skill-assembly",
      "skills": [
        {
          "action": "add",
          "skill": {
            "name": "courier-runner",
            "channel": "stable",
            "value": ["1.4.7"]
          }
        },
        {
          "action": "add",
          "skill": {
            "channel": "stable",
            "name": "chef-gohai",
            "value": ["1.2.4"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "shell-interpreter",
            "channel": "stable",
            "value": ["1.0.5"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "inspec-interpreter",
            "channel": "stable",
            "value": ["1.0.7"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "restart-interpreter",
            "channel": "stable",
            "value": ["1.0.4"]
          }
        },
        {
          "action": "add",
          "skill": {
            "name": "chef-client-interpreter",
            "channel": "stable",
            "value": ["1.0.6"]
          }
        }
      ]
    }
    

    Replace each skill’s version number with the version supported by the version of Chef 360 Platform that you’re running. See the release notes for details.

  2. Create the skill assembly:

    chef-node-management-cli management assembly create-assembly --body-file skill-assembly.json --profile <NODE_MANAGER_PROFILE_NAME>
    

    The response is similar to the following:

    {
    "item": {
        "skillAssemblyId": "e2e66c8a-79ff-4bdc-a4cd-739c3f02f9e9"
      }
    }
    

    Save the value of skillAssemblyId, you will use it to create a node cohort.

Update a skill assembly

You can add or remove skills from nodes by updating an existing skill assembly.

Add skills

  1. 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 example shell-interpreter
    • <DESIRED_VERSION> with the version you want to install
  2. Use the assembly update-assembly subcommand to update the skill assembly:

    chef-node-management-cli management assembly update-assembly --skillAssemblyId <SKILL_ASSEMBLY_ID> --body-file <PATH_TO_JSON_FILE> --profile <NODE_MANAGER_PROFILE_NAME>
    

Remove skills from a skill assembly

Use the remove action to define skills that are removed. You can use logical operators to remove a range of skills:

  1. 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 example shell-interpreter
    • <OPERATOR> with a logical operator, for example <, >, or =
    • <VERSION> with the version or versions you want to remove
  2. Use the assembly update-assembly subcommand to update the skill assembly:

    chef-node-management-cli management assembly update-assembly --skillAssemblyId <SKILL_ASSEMBLY_ID> --body-file <PATH_TO_JSON_FILE> --profile <NODE_MANAGER_PROFILE_NAME>
    

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> --profile <NODE_MANAGER_PROFILE_NAME>

Thank you for your feedback!

×