New to Kestra?
Use blueprints to kickstart your first workflows.
Run your first Ansible playbook locally with Kestra, no remote hosts needed. A beginner blueprint for Ansible orchestration, demos, and DevOps onboarding.
id: ansible-local-message
namespace: company.team
tasks:
- id: ansible
type: io.kestra.plugin.ansible.cli.AnsibleCLI
inputFiles:
inventory.ini: |
[local_servers]
localhost1 ansible_connection=local
playbook.yml: |
---
- name: Hello World Playbook
hosts: local_servers
tasks:
- name: Print Hello World
debug:
msg: "Hello World!"
commands:
- ansible-playbook -i inventory.ini -c local playbook.yml
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.
A single ansible task of type io.kestra.plugin.ansible.cli.AnsibleCLI
does all the work.
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!.commands property invokes
ansible-playbook -i inventory.ini -c local playbook.yml, forcing a local
connection so nothing leaves the machine.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.
ansible-playbook).None. This blueprint targets the local machine and references no
{{ secret('NAME') }} values.
ansible-playbook is available in the execution environment.Hello World! message.localhost1 with real hosts and swap the local connection for SSH.playbook.yml.