Ensure Server
  • 14 May 2021
  • 1 Minute to read
  • Dark
    Light
  • PDF

Ensure Server

  • Dark
    Light
  • PDF

Article Summary

This is generated from the built in components of Otter 3.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

Ensure Server

Ensures that a server exists within Otter.

Script usage:

Ensure-Server(
	Name: <text>,
	[Exists: <true/false>],
	[Roles: <@(text)>],
	[Environments: <@(text)>],
	[RoutineExecutionType: <text>],
	[AgentConfigurationXml: <text>]
);

This operation may be prefixed with Otter::, although this is a built-in namespace and isn't really necessary.

Arguments:

NameFormatScript UsageUsage Notes
Server name
text
Name
This argument is required.
Exists
true/false
Exists
Server roles
@(text)
Roles
A collection of role names that the server belongs to. Any roles specified must already exist within Otter or a warning will be issued at execution time.
Environments
@(text)
Environments
A collection of environment names that the server belongs to. Any environments specified must already exist within Otter or a warning will be issued at execution time.
Drift remediation
text
RoutineExecutionType
The method that specifies the drift remediation. Valid values are E (automatically remediate), C (report only), or N (do not collect). The default value is report only.
Agent configuration (XML)
text
AgentConfigurationXml
The serialized agent configuration that will be used by this server.

Example:

# ensures that the specified server is present within Otter
Ensure-Server(
    Name: HdarsWin12e-1A-dev,
    Roles: @(windows-east, development-1A, integration-1A),
    Environments: @(development),
    RoutineExecutionType: N  # don't automatically detect drift for this server,
    AgentConfigurationXml: >><Inedo.Otter.Extensions.Agents.Tcp.TcpAgent Assembly="OtterCoreEx">
<Properties HostName="HdarsWin12e-1A-dev" Port="46336" SslRequired="False" />
</Inedo.Otter.Extensions.Agents.Tcp.TcpAgent>>>
);

Was this article helpful?