Reference - Steps

The steps list is required in the root of the Playbook.

Summary

  • Steps contains a list of the high-level operations your task performs.

  • You can define as many steps as you need.

  • Each individual step in the list is a dictionary.

Required Keys

name

A name used to identify the group of actions inside the step.

actions

A list of actions.

Validation will fail without all required keys

Optional Keys

when

  • Perform the step if a condition is met

  • Its value is a Python expression returning True or False

Info

See more in the conditionals section.

sequence

  • Perform the step for each item in a list

Info

See more in the for loops section.

until

  • Perform the step until a condition is met

Info

See more in the while loops section.

Example

  • This snippet shows two named steps.

  • Each step performs a single action.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
steps:

  - name: Find Active Directory Groups
    actions:
      - active_directory.groups.search:
          sAMAccountName: Operations*
        load:
          connection_info: active_directory_details
        save: operations_groups 

  - name: Select Groups to Audit
    actions:
      - active_directory.groups.input_table:
          text: Please Select 1 or more Groups
        load:
          group_list: operations_groups
        save: selected_groups