Referencing values in Scripts

All Variables have the same basic attributes regardless of their type. The Values that are mapped onto the Variables in the Plan are different – they have a number of different attributes depending on the type of value.

Using Variables in Procedures

Variables are used in Procedures to refer to values. These values are held in Values which are mapped onto the relevant Variables in a Plan prior to the Procedure being executed.

Procedures are composed of steps, and each step has a unique name and a number of other attributes, including a script section, where the actual commands for executing the step are written. In these commands, curly braces { } are used to delimit values which are referenced by variables.

In order to be used in a script the Variable names are stripped of any separating spaces between words and converted to camelcase – with only the first letter of the second, and any subsequent words, capitalised.

So a Variable called – THIS IS my name would be converted to thisIsMyName

Values are referenced in scripts as {placeHolderName.placeValueAttribute}

So for a Variable with name THIS IS my name of type Server We could refer to the IP address in a script as {thisIsMyName.ip}

The expressions contained in the curly braces are evaluated prior to job, and the curly brace expressions are replaced by actual values before the script is run. In the example above {thisIsMyName.ip} would be substituted with the value of the IP attribute of the PlaceValue that was assigned to the Variable THIS IS my name in the Plan.

This substitution of values is performed by Attune, so using the curly Brace {} notation to reference attribute values works with all scripts regardless of the type of script – it will work with Bash, Windows Powershell, Python, etc.

Referencing value attributes in Steps

OS Credential

Attributes of Type OS credential can be referenced as follows:

VariableValueScript Reference
Namename{myPlaceHolder.name}
Useruser{myPlaceHolder.user}
Passwordpassword{myPlaceHolder.password}
Commentcomment{myPlaceHolder.comment}

SQL Credential

Attributes of Type SQL credential can be referenced as follows :

VariableValueScript Reference
Namename{myPlaceHolder.name}
Useruser{myPlaceHolder.user}
SIDsid{myPlaceHolder.sid}
Passwordpassword{myPlaceHolder.password}
As SysdbaasSysDba{myPlaceHolder.asSysDba}
Commentcomment{myPlaceHolder.comment}

Server

Attributes of Server are referenced as follows:

VariableValueScript Reference
Namename{myPlaceHolder.name}
IP Addressip{myPlaceHolder.ip}
Hostnamehostname{myPlaceHolder.hostname}
Domain Namedomain{myPlaceHolder.domain}
Commentcomment{myPlaceHolder.comment}

Server Group

Server Group is an comma separated list of Server values (CSV), Attributes of Server Group are referenced as follows:

VariableValueScript Reference
Namename{myPlaceHolder.name}
ServerserverNames{myPlaceHolder.serverNames} as CSV
ServerserverIps{myPlaceHolder.serverIps} as CSV
ServerserverHostnames{myPlaceHolder.serverHostnames} as CSV
ServerserverTypes{myPlaceHolder.serverTypes} as CSV
The types are:
– 1 = Linux
– 2 = Windows
ServerserverDomains{myPlaceHolder.serverDomains} as CSV
ServerserverFqns{myPlaceHolder.serverFqns} as CSV
Commentcomment{myPlaceHolder.comment}

IPv4 Subnet

Attributes of the “IPv4 Subnet” value are referenced as follows:

VariableValueScript Reference
Namename{myPlaceHolder.name}
Subnetsubnet{myPlaceHolder.subnet}
Netmasknetmask{myPlaceHolder.netmask}
Gateway IPgateway{myPlaceHolder.gateway}
DNS IP 1dns1{myPlaceHolder.dns1}
DNS IP 2dns2{myPlaceHolder.dns2}
Commentcomment{myPlaceHolder.comment}

Text

Attributes of Type Text can be referenced as follows:

VariableValueScript Reference
Namename{myPlaceHolder.name}
Valuevalue{myPlaceHolder.value}
Commentcomment{myPlaceHolder.comment}