Ansible: Run Playbook
Description
Use the step to execute an Ansible-playbook command and return the result over secure shell(ssh) TCP/IP protocol.
Reference: Ansible
Configurations
Field name | Description |
---|---|
Step name | Specify a unique name for the step. |
CONNECTION tab: | Connection Fields |
Server name / IP address | Specify the Server name or IP address of the machine on which you want to execute a command. The field is mandatory. |
Server port | Specify the TCP/IP port on which ssh protocol lives on the server. The default is 22. |
Timeout | Specify the timeout in seconds. If set to a number larger than zero you can specify a non-default connection timeout. |
Username | Specify the username to log in with. |
Password | |
Accept value as variable/ static | Leave checkbox unchecked to accept Password from a field in the previous steps of the stream using a drop down list. Else select the checkbox for Password field to appear as text box. |
Password | Specify the Password. The field is mandatory. Password is entered using a widget. The widget handles both Text (static value or environment variable) and Combo (dropdown containing values from previous steps). If checkbox above is enabled Password field appears as text box. Else if checkbox above is disabled Password field appears as a dropdown to select fields from previous steps. |
Use key | Enable the option if you want to log in using a private key. |
Private key | The private key file. The private part of a private/public RSA key-pair (see: ssh-keygen). |
Passphrase | Specify the optional pass-phrase used when the key-pair was generated. |
Proxy host | In case the machine is in a proxy environment, specify the proxy server host to use (name or IP address). |
Proxy port | Specify the proxy server port to use. |
Proxy username | Specify the proxy user name. |
Proxy Password | |
Accept value as variable/static | Leave checkbox unchecked to accept Proxy Password from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Proxy Password field to appear as text box. |
Proxy password | Specify the Proxy password. The field is mandatory. Proxy Password is entered using a widget. The widget handles both Text (static value or environment variable) and Combo (drop down containing values from previous steps). If checkbox above is enabled Proxy Password field appears as text box. Else if checkbox above is disabled Proxy Password field appears as a drop down to select fields from previous steps. |
Test Connection | Click to see if the supplied credentials are sufficient for logging into the SSH server. |
INPUT tab: | Input Fields |
Host / Client | Specify the server Name or IP address or Group Name of machine which is already present in hosts file and on which you want to perform operation using Ansible. Note: Comma separated values are allowed in this field. |
Playbook File Path (on Ansible CLI Machine) | Specify YAML File path or Directory path on Ansible CLI Machine. (if user provides a static or environment value and user provides “/”, it will auto populate the current directory list in dropdown). Note: If user provides value for Playbook File Path (on Ansible Machine) as Static or environment variable, then user can press Linux file separator “/” to auto populate the directory list in dropdown. If Both Playbook File Path (on Ansible CLI Machine) and YAML File Path field contains full Yaml path, then first preference will be given to Playbook File Path (on Ansible CLI Machine). If Playbook File Path (on Ansible CLI Machine) contains directory and YAML File Path field contains yaml file with extension, then path will be created as Playbook File Path (on Ansible CLI Machine) + “/” +name of file with extension from YAML File Path field. If Copy/Replace YAML File To Playbook File field value is “Yes” then local yaml file will be created on Playbook File Path (on Ansible CLI Machine) with given directory structure. (if Playbook File Path (on Ansible CLI Machine) Field contains full YAML file path with extension then no file will be copied on Ansible CLI Machine.) If there is special character in filename, then please provide escape characters as per Linux standards. |
YAML File Path | Specify Local Machine YAML file path. Note: If there is special character in filename, then please provide escape characters as per Linux standards. |
Browse | Browse local YAML file and selected file path loaded into YAML File Path. |
Supporting File | Specify the supporting file name to be copied to the Ansible CLI machine. You can also Browse for the files and click Add to add to the following list. Note: Variables and previous fields are also allowed in this field. |
Supporting File List | Displays the playbook supporting files to be copied to the Ansible CLI machine. |
Copy / Replace YAML File To Playbook File Path | If value is ‘Yes’ then copies local YAML file at Ansible CLI Machine at given Playbook File Path Directory. And if Directory not exists it will create the given Directory. Allowed Values: ‘Yes’ and ‘No’. Default Value ‘No’. |
Accept Parameter As JSON | Specify Yes to accept Ansible extra-var parameters in JSON format else No to specify parameters as key-value pairs in the Parameters table. The default value is No. |
JSON | If Yes is provided in the field above, Specify a JSON string for Ansible extra-var parameters. Sample JSON: {"name":"Bob", "email":"bob32@gmail.com"} |
Parameters | Specify Key = Value in table field if Checkbox is unchecked. Note: If you are using Table for parameters and you need to specify space separated value or special characters in value then provide value in single quote. |
Get | Fetches parameters from Playbook File Path and YAML File Path. Priority will be given to Playbook File Path if both Playbook File Path and YAML File Path contains YAML file extension. Note: Get button will fetch YAML file parameters and show in Parameters table from any of Playbook File Path (on Ansible CLI Machine) or YAML File Path field. If both are given, then priority will be given to Playbook File Path (on Ansible CLI Machine) |
Wait For Response/Max Execution Timeout | Specify timeout duration in seconds. Default 0. When it is 0 it waits for infinite time until result comes. If greater than 0, then wait for specified timeout seconds. |
PRIVILEGE ESCALATION tab: | Privilege Escalation (Client Machine) |
Use Become | Become another User to execute Playbook. Allowed Values: ''Yes'', ''No''. Default value is ''No''. |
Become Method | Specify the privilege escalation method to use (default=sudo). Allowed Values: ''sudo'', ''su''. |
Username/ Become Username | Run playbook operations as this user (default=root) Known Issue: If user provides any special sequence of characters which can be used in Ansible commands in Become User field, then workflow is stuck for infinite time. |
Become Password: | |
Accept value as variable/static | Leave checkbox unchecked to accept Become Password from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Become Password field to appear as Text box. |
Become Password | Specify the Become Password. This field is mandatory. Become Password is entered using a widget. The widget handles both Text (static value or environment variable) and Combo (drop down containing values from previous steps). If checkbox above is enabled Become Password field appears as Text box. Else if checkbox above is disabled Become Password field appears as a drop down to select fields from previous steps. |
Vault Key | Specify the ‘Vault ID without label’ or the ‘location of file’. Note: Vault IDs help you encrypt different files with different passwords to be referenced inside a playbook. Vault Key is used when multiple level passwords are used. References: Vault OR vault |
Vault Password File Path | Specify the ‘Vault Password File Path ‘ or ‘Vault ID Label’. See the URL: Vault OR vault |
EXTRA PARAMETER tab: | Extra Ansible Parameters |
Get Input Fields | In this pane the field from previous steps are visible. |
Extra Ansible Arguments | Specify any extra arguments which will be appended to Ansible-Playbook command. like --force-handlers, --flush-cache, -f <FORKS>, -t <TAGS>, --syntax-check, --list-tags, etc. Note: You can separate these arguments with a space. |
Prefix Command With Sudo | Specify whether to prefix ansible-playbook command with sudo. Allowed Value: Yes/No. Default is No. |
OUTPUT tab: | Output fields |
Response fieldname | Specify the name of the String output field that will contain the text passed to the standard output channel (stdOut) by the specified commands. This information can then be picked up by the step and passed in a field to subsequent steps. |
Error response field name | The name of the String output field that will contain the text passed to the standard error channel (stdErr) by the specified commands. This information can then be picked up by the step and passed in a field to subsequent steps. |