Skip to main content

run

The run command executes a workflow against target nodes. This is the primary command for running infrastructure automation tasks with actor-IaC.

Synopsis

actor-iac run -d <directory> -w <workflow> [options]

Description

The run command loads a workflow definition from the specified directory, optionally applies an overlay for environment-specific customization, and executes the workflow. When an inventory file is provided, the workflow runs against remote nodes via SSH. Without an inventory, the workflow runs locally.

During execution, all actions and their results are logged to an H2 database. The command exits with code 0 on success and non-zero on failure.

Required Options

OptionDescription
-d, --dir <directory>Directory containing workflow files. This directory is scanned recursively for YAML, JSON, and XML files.
-w, --workflow <name>Name of the workflow to execute. You can specify the name with or without the file extension.

Optional Options

Inventory and Targeting

OptionDescription
-i, --inventory <file>Path to an Ansible-compatible inventory file. When specified, the workflow executes against remote nodes via SSH.
-g, --group <name>Host group to target from the inventory. Defaults to all if not specified.
--limit <hosts>Limit execution to specific hosts. Accepts a comma-separated list of hostnames or IP addresses.

Authentication

OptionDescription
-k, --ask-passPrompt for SSH password before execution. By default, actor-IaC uses SSH agent for key-based authentication.

Overlay System

OptionDescription
-o, --overlay <directory>Overlay directory containing overlay-conf.yaml. Variables, patches, and name transformations from the overlay are applied to the base workflow before execution.
--render-to <directory>Render overlay-applied workflows to the specified directory without executing. Useful for previewing the merged workflow.

Execution

OptionDescription
-t, --threads <count>Number of worker threads for CPU-bound operations. Defaults to 4.
-v, --verboseEnable verbose output with detailed logging of each step execution.

Logging

actor-IaC supports three independent log outputs. Each can be enabled/disabled separately:

Console Output (stdout/stderr)

OptionDescription
-q, --quiet, --no-console-logSuppress all console output (stdout/stderr). Useful for high-performance batch execution where console output would slow down execution.

Text File Logging

OptionDescription
--file-log, -l, --log <file>Enable text file logging and specify output path. Text logging is disabled by default; only database logging is used unless this option is specified.
--no-file-log, --no-logExplicitly disable text file logging. (Since text logging is disabled by default, this option is mainly useful for clarity in scripts.)

Database Logging (H2)

OptionDescription
--db-log, --log-db <path>H2 database path for structured logging. Defaults to actor-iac-logs in the current directory (where the command is executed).
--no-db-log, --no-log-dbDisable H2 database logging.
--db-log-server, --log-serve <host:port>Connect to an H2 log server at the specified address. Enables multiple workflow processes to share a single log database. Falls back to embedded mode if the server is unreachable.
--embeddedForce embedded H2 database mode instead of auto-detecting or starting a TCP server.

Display

OptionDescription
-c, --cowfile <name>Cowsay character to display at the beginning of each step. Use --cowfile list to show available characters. Defaults to default. See Cowsay Characters for details.

Other

OptionDescription
-L, --list-workflowsList discovered workflows and exit without executing.

Examples

Basic Local Execution

Run a workflow locally without an inventory:

./actor_iac.java run -d ./workflows -w hello-world

Remote Execution with Inventory

Run a workflow against all nodes in the webservers group:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini -g webservers

Using an Overlay

Apply a production overlay to the base workflow:

./actor_iac.java run -d ./workflows -w deploy -o ./overlays/production -i inventory.ini

Password Authentication

Prompt for SSH password instead of using SSH agent:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini -g webservers -k

Targeting Specific Hosts

Limit execution to specific hosts:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --limit=192.168.1.10,192.168.1.11

Verbose Mode

Enable detailed logging for troubleshooting:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini -v

Using a Log Server

Connect to a shared log server for centralized logging:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --db-log-server=localhost:29090

High-Performance Execution

Disable console output for maximum performance (text file logging is disabled by default):

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --no-console-log

Minimal Logging

Disable all logging outputs (console, text file, and database):

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --no-console-log --no-file-log --no-db-log

Preview Merged Workflow

Render the overlay-applied workflow to see the final result without executing:

./actor_iac.java run -d ./workflows -o ./overlays/production --render-to ./rendered

Custom Cowsay Character

Use a different cowsay character for step display:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --cowfile tux

List available cowsay characters:

./actor_iac.java run --cowfile list

Exit Codes

CodeDescription
0Workflow completed successfully
1Workflow failed or encountered an error
2Invalid command-line options

Logging Behavior

By default, the run command outputs to two destinations:

  1. Console: Real-time output to stdout/stderr (disable with --no-console-log or -q)
  2. H2 database: Structured logs in the current directory (e.g., ./actor-iac-logs.mv.db). Disable with --no-db-log.

Optionally, you can enable text file logging:

  1. Text file: Enable with -l, --log <file> to write logs to a text file. This is disabled by default to avoid creating many log files during batch execution.

The database log enables structured querying with the log-search command. Each execution creates a new session with metadata about the workflow, overlay, inventory, and final status.

Performance Tip

For high-performance batch execution, disable console output which can significantly slow down execution:

./actor_iac.java run -d ./workflows -w deploy -i inventory.ini --no-console-log

See Also