Chef · Arazzo Workflow

Chef Define a Role and Assign It to a Node

Version 1.0.0

Create a role, read it back, then place it in a node's run list.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Application DeliveryAutomationComplianceConfiguration ManagementDevOpsDevSecOpsHabitatInfrastructure as CodeInSpecArazzoWorkflows

Provider

chef

Workflows

assign-role-to-node
Create a Chef role and apply it to a node's run list.
Creates the role, verifies it exists on the server, then amends the target node's run list to include the role.
4 steps inputs: chefEnvironment, defaultAttributes, nodeName, nodeRunList, roleDescription, roleName, roleRunList outputs: nodeRunList, roleName, roleRunList
1
createRoleObject
Create the role with its run list and default attributes. The Infra Server returns 409 if the role name is already taken.
2
readBackRole
Read the role back to confirm the server stored the run list before any node is pointed at it.
3
readTargetNode
Read the target node so its environment and attributes survive the whole-object PUT that follows.
4
applyRoleToNode
Write the node back with the role in its run list so the next chef-client run picks up the role's recipes and attributes.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Chef Define a Role and Assign It to a Node
  summary: Create a role, read it back, then place it in a node's run list.
  description: >-
    Roles are how Chef expresses a reusable server persona, and this is the flow
    that puts one into service. The workflow creates the role with its run list
    and default attributes, reads it back to confirm the server expanded and
    stored it, then reads the target node and writes the role into that node's
    run list. Doing the read-back before touching the node matters: a node run
    list that references a role the server does not have fails at converge time
    rather than at write time. Each step spells out its request inline so the
    flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: nodesApi
  url: ../openapi/chef-nodes-api-openapi.yml
  type: openapi
- name: rolesApi
  url: ../openapi/chef-roles-api-openapi.yml
  type: openapi
workflows:
- workflowId: assign-role-to-node
  summary: Create a Chef role and apply it to a node's run list.
  description: >-
    Creates the role, verifies it exists on the server, then amends the target
    node's run list to include the role.
  inputs:
    type: object
    required:
    - roleName
    - nodeName
    properties:
      roleName:
        type: string
        description: The role name to create (e.g. base).
      roleDescription:
        type: string
        description: A human readable description of what the role does.
      roleRunList:
        type: array
        description: The run list the role expands to (e.g. ["recipe[ntp]", "recipe[users]"]).
        items:
          type: string
      defaultAttributes:
        type: object
        description: Default-precedence attributes carried by the role.
      nodeName:
        type: string
        description: The node that should take on the role.
      nodeRunList:
        type: array
        description: The node's full amended run list, including "role[<roleName>]".
        items:
          type: string
      chefEnvironment:
        type: string
        description: The Chef environment to keep on the node object.
  steps:
  - stepId: createRoleObject
    description: >-
      Create the role with its run list and default attributes. The Infra Server
      returns 409 if the role name is already taken.
    operationId: createRole
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.roleName
        chef_type: role
        json_class: Chef::Role
        description: $inputs.roleDescription
        run_list: $inputs.roleRunList
        default_attributes: $inputs.defaultAttributes
        override_attributes: {}
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      roleUri: $response.body#/uri
  - stepId: readBackRole
    description: >-
      Read the role back to confirm the server stored the run list before any
      node is pointed at it.
    operationId: getRole
    parameters:
    - name: roleName
      in: path
      value: $inputs.roleName
    successCriteria:
    - condition: $statusCode == 200
    - context: $response.body
      condition: $.name == '$inputs.roleName'
      type: jsonpath
    outputs:
      roleName: $response.body#/name
      roleRunList: $response.body#/run_list
  - stepId: readTargetNode
    description: >-
      Read the target node so its environment and attributes survive the
      whole-object PUT that follows.
    operationId: getNode
    parameters:
    - name: nodeName
      in: path
      value: $inputs.nodeName
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentRunList: $response.body#/run_list
      normalAttributes: $response.body#/normal
  - stepId: applyRoleToNode
    description: >-
      Write the node back with the role in its run list so the next chef-client
      run picks up the role's recipes and attributes.
    operationId: updateNode
    parameters:
    - name: nodeName
      in: path
      value: $inputs.nodeName
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.nodeName
        chef_type: node
        json_class: Chef::Node
        chef_environment: $inputs.chefEnvironment
        run_list: $inputs.nodeRunList
        normal: $steps.readTargetNode.outputs.normalAttributes
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      nodeRunList: $response.body#/run_list
  outputs:
    roleName: $steps.readBackRole.outputs.roleName
    roleRunList: $steps.readBackRole.outputs.roleRunList
    nodeRunList: $steps.applyRoleToNode.outputs.nodeRunList

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/chef-role-assignment-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.