Ansible
Run the same command on several servers at once and view the per-server results together. There is no confirmation dialog before a run, so read the cautions in this chapter first.
Layout of the Ansible view
Press Ansible in the Navigation rail to open it. Choose servers and connect on the left; run commands and view results on the right.
Servers
Choose servers from the list of scanned instances.
Connection buttons
Connect, Test connection, Disconnect all.
Command input
Contains the command to run and the sudo, Timeout and Run buttons.
Results
Per-server success or failure and output stack up as cards.
This view is a tool for batch-running shell commands over SSH. Despite its name, it does not run Ansible playbooks, inventories or modules.
Ansible does not need to be installed on either the PC or the servers.
In this chapter, the instances in the list are called hosts, as they are labeled on screen.
Host list
Servers lists only instances whose status in the scan result is ACTIVE. Stopped instances and manual instances are not listed.
Servers
The total number in the list and the number connected now (N connected).
Filter and selection
Narrow the list with Filter by name or IP. Select all selects or clears everything; Select connected selects only connected hosts.
Configured host
Click a row to select it and click again to clear it. The dot is gray (not connected), orange (connecting) or green (connected), with
IP:Portand the response time below.Failed host
Shows a red dot and the beginning of the error message. Hover over the row to see the full message.
Not configured
A host with no saved SSH settings. Clicking the row does not select it; the SSH settings dialog opens instead.
Bottom buttons
Connect N hosts, Test connection, Disconnect all. Connect is off when no host is selected.
SSH settings dialog
A Not configured host can be selected only after its connection settings are saved once. Instances already saved in Terminal can be selected right away.
Press Configure
Clicking the row of a Not configured host or its Configure button opens the SSH settings dialog. The host name and IP are shown below the title.
Fill in Connection
User is required. Port is prefilled with
22.Choose Authentication
If Method is Key, choose a registered key in Key profile; if it is Password, enter the password. Keys are registered in Terminal. (chapter 6)
Press Save
If a value is missing,
Username is required,Select a key profileorPassword is requiredis shown. Once saved, the host can be selected.To edit later
This dialog does not open for a host that is already configured. Open that instance's connection dialog from the Instances panel in Terminal and edit it there. (chapter 7)
Connect, test, disconnect
Commands run only on connected hosts. Choose hosts first and connect them with Connect.
- CONNECT
Connect N hosts
Connects to the selected hosts over SSH. Up to 10 hosts are connected at the same time.
Connection settings are looked up in this order.
- Settings saved for the selected IP
- Settings saved for that instance
- SSH default settings (the port is
22in this case)
If the user name is empty, it is guessed from the image name (
ubuntu,rockyand so on); if it cannot be determined,rootis used. - ROUTE / TEST
Routes and Test connection
- If the instance and IP are registered as a target of a Jump server, the connection goes through that Jump server. DNAT mapping is not used. (chapter 7)
- Test connection checks only the connected hosts among those selected. The response time is shown as, for example,
18ms; a host that does not respond changes to failed.
- DISCONNECT
Disconnect all
- Ends every connection with no confirmation dialog. There is no way to disconnect only chosen hosts.
- Switching to another project disconnects everything automatically.
- Connections and results remain when you move to another view and come back.
- These connections are separate from Terminal session tabs.
Writing and running a command
Type a command and press Run; it runs simultaneously on every host that is both selected and connected. Up to 20 hosts run at a time.
Command field
Type the shell command to run.
Ctrl+Enteralso runs it.sudo
When on,
sudo -nis prepended to the command. It fails for accounts that are asked for a password.Timeout
30s,60s(default),120s,300s. Hosts that exceed it are marked Timeout.Selection status
The number of run targets. With no targets,
No connected hosts selectedis shown.Run on N hosts
Runs the command. During a run it changes to Running… and cannot be pressed again.
Viewing results
A result card is added as each host finishes. Cards appear collapsed; click one to expand its output.
Summary
The Success, Failed and Timeout counts, the host count and the elapsed time. During a run,
RunningandN completedare shown.Expand all / Collapse all
Expands or collapses all cards at once.
Executed command
The command actually sent to the servers. With sudo on, it appears with
sudo -nprepended.Host card
Shows the status, name, IP,
exitcode and elapsed time. The button on the right (Copy output) copies the output and errors to the clipboard.Failed host
Click stderr (N lines) to expand the error output. With no output at all,
No outputis shown.
Records sent to the central audit serverOff in the current version
What you connect to and run in the Ansible view is sent to the central audit server as audit records. It is sent even when you are not connected to the Central gateway.
| Action | What is sent |
|---|---|
| Common to all records | PC name (host name), action type, success or failure |
| Connect | One record per host: target IP and instance name. On failure, the error message |
| Test connection | Host count, per-host ID and connection state |
| Run | The full command that was run (including sudo -n), host count, success count and failure count. If the run itself fails, the error details |
| Disconnect all | One record per host that was connected: IP and instance name |
| What is not sent | Command output (stdout, stderr), SSH passwords and keys |