Activities
- Connect to Ansible
- Disconnect from Ansible
- Check Host
- Inventory Create
- Inventory Delete
- Inventory Create
- Inventory Update
- Script Execution
Connect to Ansible
This activity connects to Ansible.The Output of this activity should be used as input for all Connection parameters used for activities placed under Ansible category.
Activity Parameters
The Connect to Ansible activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Host name / IP Address (text box editor type) (type: string): the DNS name or IP Address of the SSH host.
- Password (password editor type) (type: string): the password for the provided username.
- Password Binding (text box editor type) (type: string): bind to a variable containing the encrypted password for the SSH host. (This parameter is used only when the user wants to send an encrypted password from outside the workflow, for example Flowster Portal).
- SSH Port (text box editor type) (type: Int32): default value for the SSH port is 22.
- SSH Timeout (text box editor type) (type: Int32): default value for the SSH timeout is 60 seconds to establish a SSH connection to the specified host.
- Username (text box editor type) (type: string): the username to connect to the SSH Ansible host.E.g. 'root'
The Read Only Output variable are the possible output values that the activity will provide:
- Connection (type: object): outputs an Ansible Connection. This parameter should be used as input for all Connection parameters used for activities placed under Ansible category.
Disconnect from Ansible
This activity disconnects from Ansible.
Activity Parameters
The Disconnect from Ansible activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
Check Host
This activity checks if host(s) exists (ansible command ping).
Activity Parameters
The Check Host activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Hosts (text box editor type) (type: String[]): enter hosts array of strings .E.g. New String() {"hostname1", "hostname2"}
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: List <KeyValuePair <String,String>>): outputs a list of returned ansible command result (ping) for each host.
In order to iterate through the list of results to extract the key and value for each host, use an iteration activity, e.g. Custom ForEach and use a logging/assign activity to display/assign the iterator.Key and iterator.Value:
If you only wish to extract a specific element from the list, use Get KeyValuePair activity based on Index or Key value:
Inventory Create
This activity adds the specified groups and/or hosts to the inventory.
Activity Parameters
The Inventory Create activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Group (text box editor type) (type: string): enter group name to be created. E.g. Flowster. If the group does not exist, it will be automatically created.
- Hosts (collection editor type) (type: string): enter the hosts associated with machines IP . E.g. host1 and machine IP 10.201.0.45
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: List <KeyValuePair <String,String>>): outputs a list of KeyValuePair of group→host for each host added to the inventory.
Inventory Delete
This activity deletes the specified groups and/or hosts from the inventory.
Activity Parameters
The Inventory Delete activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Group (text box editor type) (type: string): enter group name. E.g. Flowster.
- Hosts (text box editor type) (type: String[]): enter hosts array of strings to be deleted from the specified group .E.g. New String() {"hostname1", "hostname2"} . If left empty, the group will be deleted from inventory.
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: Boolean): outputs true or false if operation succeeded.
Inventory Read
This activity reads an inventory of groups and hosts, if existent.
Activity Parameters
The Inventory Read activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Group (text box editor type) (type: string): enter group name. E.g. Flowster. This parameter takes precedence over Hosts parameter. If both parameters are empty, the result will contain all groups with all hosts existent on the inventory.
- Hosts (text box editor type) (type: String[]): enter hosts array of strings .E.g. New String() {"hostname1", "hostname2"}
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: List <KeyValuePair <String,String>>): Outputs a list of KeyValuePairs with key : group name and value: host;info . E.g. value returned for host1 will be stored as host1;ansible_ssh_hostroot@10.10.10.1
In order to iterate through the list of results to extract the key and value for each host, use an iteration activity, e.g. Custom ForEach and use a logging/assign activity to display/assign the iterator.Key and iterator.Value:
If you only wish to extract a specific element from the list, use Get KeyValuePair activity based on Index or Key value.
Inventory Update
This activity updates the specified groups and/or hosts from the inventory.
Activity Parameters
The Inventory Update activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Groups (collection editor type) (type: string): enter the old name and new name for the groups to be updated. E.g. when the collection editor opens, add a new member for each item to be updated, where Name = old value and Value = new value.
- Hosts (collection editor type) (type: string): enter the old name and new name for the hosts to be updated. E.g. when the collection editor opens, add a new member for each item to be updated, where Name = old value and Value = new value.
- IPs (collection editor type) (type: string): enter the old IP and new IP for all IPs to be updated. E.g. when the collection editor opens, add a new member for each item to be updated, where Name = old value and Value = new value.
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: Boolean): outputs true or false if operation succeeded.
Script Execution
This activity executes ansible script on each host from inventory.
Activity Parameters
The Script Execution activity parameters can be provided by manual inserted values or via IN arguments or variables:
Parameters:
- Connection (text box editor type) (type: object): the Ansible Connection object. The output parameter from Connect To Ansible activity should be used as Input here.
- Command (text box editor type) (type: string): enter the command . E.g. 'date' will display current date time on each host.
The Read Only Output variable are the possible output values that the activity will provide:
- Output (type: String): Outputs the ansible command result