Job Template parameters and surveys

In Ansible a Job Template or Workflow Job Template can define a number of parameters and properties. They can be defined directly in Ansible’s template itself, or can be set to prompt on launch. Every parameter that's set to be prompted must be supplied during template launch by Runbook Automation. In the case of an Ansible action executed through Runbook Automation, this translates to action parameters.

Job Templates in Ansible can accept input for the following parameters:

  • diff_mode (type: boolean)
  • extra_vars (type: string in JSON format)
  • inventory (type: integer)
  • credentials (type: integer; enumeration with labels)
  • limit (type: string)
  • verbosity (type: integer; range 0-5)
  • tags (type: string)
  • skip_tags (type: string)
  • scm_branch (type: string)
  • execution_environment (type: integer; enumeration with labels)
  • labels (type: integer array; enumeration with labels)
  • forks (type: integer)
  • job_slice_count (type: integer)
  • timeout (type: integer)
  • instance_groups (type: integer array; enumeration with labels)

Note: Runbook Automation supports only single values for the "credential" parameter. Launching job templates that require more than one credential value to be specified is not supported.

Workflow Job Templates in Ansible can accept input for the following parameters:

  • extra_vars (type: string in JSON format)
  • inventory (type: integer)
  • labels (type: integer array; enumeration with labels)
  • tags (type: string)
  • skip_tags (type: string)

Additionally, you can define any number of additional parameters to be prompted from the user through the survey. For every parameter defined in the survey an additional Action parameter is created. These parameter names are prefixed with extraVariables. and have a schema similar to the one defined for the survey parameter. For example, if you define a survey parameter with the name "age" and define it as an integer with minimum value 0 and maximum value of 99, then the Action will have a parameter called "extraVariables.age" of type "integer", with minimum value of 0 and maximum value of 99.

Note: Float and textarea parameters are not yet supported and will not show up as independent parameters. If you have surveys using these types of survey parameters, enable the Prompt on launch flag for the Extra Variables selection in your template. That way users can specify the values using the extraVariables. parameter.

The Ansible Action Provider will harvest the existing Job Templates and Workflow Job Templates and create matching Actions out of them. Those Actions are automatically created and kept synchronized with Ansible. They cannot be changed inside Runbook Automation. To change these Actions, directly edit the Job Template or Workflow Job Template inside Ansible. Runbook Automation will pick up the change and update the Action referencing the asset. Note that harvested templates are cached in Runbook Automation, so changes made to the original templates might take up to five minutes to be reflected in the corresponding Actions.

If an Ansible Action changes, make sure to update any parameter mappings made towards that Action in your runbooks.

If a parameter is set to Prompt on launch in Ansible, but also defines a value, Runbook Automation will import the default value defined in Ansible into the automation parameter.

During execution of Ansible Actions the Runbook Automation UI ensures that you can only pass values that conform to the parameter schemas. If you are using the API, make sure to pass the correct values by comparing your input to the parameter schemas.

Define default values in Ansible for parameters you want to prompt for. For more details on parameters, see the Ansible Documentation for Job Templates or Workflow Job Templates.