Run an Ansible playbook end to end from Kestra without provisioning remote
servers or cloud infrastructure. This beginner-friendly blueprint covers the
fundamentals of Ansible orchestration: it defines an inventory and a playbook
inline, executes them against the local machine, and lets you observe the
whole run from the Kestra UI. It is the fastest way to learn how Ansible
automation, Infrastructure as Code (IaC), and a workflow orchestrator fit
together before you scale to real hosts.
How it works
A single ansible task of type io.kestra.plugin.ansible.cli.AnsibleCLI
does all the work.
- The task ships two
inputFiles into its working directory: an
inventory.ini that declares a local_servers group pointing at
localhost1 with ansible_connection=local, and a playbook.yml that
runs a single debug task printing Hello World!.
- The
commands property invokes
ansible-playbook -i inventory.ini -c local playbook.yml, forcing a local
connection so nothing leaves the machine.
- Kestra captures stdout, the exit status, and execution metadata so the
playbook output is visible directly in the Outputs and Logs tabs.
What you get
- A working Ansible run with zero remote infrastructure.
- Inline inventory and playbook definitions you can edit in place.
- Full execution logs and outputs surfaced in the Kestra UI.
- A clean starting point for real IaC and configuration-management flows.
Who it's for
- Ansible beginners learning the playbook and inventory model.
- DevOps and platform engineers onboarding to Kestra.
- Anyone building a demo or proof of concept around Ansible automation.
Why orchestrate this with Kestra
Ansible has no built-in scheduler, no retry engine, and no central place to
see run history. Kestra fills that gap. You declare the playbook in
versioned, declarative YAML, attach event or schedule triggers, set
automatic retries on failure, and get execution lineage, logs, and outputs
in one UI. As your automation grows you can chain Ansible runs with other
tasks (Git checkouts, notifications, cloud APIs) in the same orchestrated
pipeline instead of stitching together cron jobs and shell scripts.
Prerequisites
- A running Kestra instance with the Ansible plugin available.
- Ansible installed in the task execution environment (or run the task in a
Docker image that bundles
ansible-playbook).
Secrets
None. This blueprint targets the local machine and references no
{{ secret('NAME') }} values.
Quick start
- Add this blueprint to your Kestra instance.
- Confirm
ansible-playbook is available in the execution environment.
- Execute the flow.
- Open the Logs and Outputs tabs to see the
Hello World! message.
How to extend
- Replace
localhost1 with real hosts and swap the local connection for SSH.
- Add roles, variables, and multiple plays to the
playbook.yml.
- Pull playbooks from a Git repository with the Git plugin.
- Add a schedule or event trigger and retry policy for production runs.
- Pass inventory or extra-vars values through Kestra inputs.
Links