Skip to content

Run Ansible and Terraform

Open the Automation tool window (right tool window bar) → folder with + → choose the repository with your playbooks and *.tf files. The folder becomes a project; the work folder of the Git menu and the agents stays as it was. Show in Project shows its files in the Project window.

If ansible-playbook or tofu is missing, Missing tools has an Install button (Homebrew). A tool in the project’s .venv is used before the Homebrew one.

  1. Playbook: e.g. playbooks/db.yml.
  2. Inventory: ansible.cfg uses the inventory of ansible.cfg; or pick one found in the project.
  3. Limit: db:&prod (only hosts in both groups).
  4. Tick vault password when the variables are encrypted and become password when sudo asks for one.
  5. Check.

Playbook check line

The line and what it touches are shown below the form, e.g. that tasks with check_mode: false make their changes also with --check. Run opens a tab in the bottom terminal; Ansible asks for the passwords there.

When the check looks right, Run… builds the same line without --check and asks for confirmation before it runs.

  1. In Terraform / OpenTofu, choose tofu or terraform.
  2. For a configuration that is not initialized, Init first.
  3. Optional: Workspace and Var file (e.g. env/eu-central-1.tfvars).
  4. Plan: reads the infrastructure, changes nothing.
  5. Apply…: confirm the line here; the CLI shows the plan again and asks for yes in the terminal.

The tab’s run bar has Stop, Restart and the exit code; Ctrl+C in the tab stops the CLI the usual way (Terraform and OpenTofu release the state lock when interrupted once).

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close