New to Kestra?
Use blueprints to kickstart your first workflows.
Roll out Ansible OS patches across your fleet wave by wave with Kestra, health-checking between each wave and halting the rollout on the first failure.
Patch your server fleet safely with Ansible, one inventory group at a time, with an automated health gate between every wave. This blueprint runs an Ansible patch playbook against the first wave, probes a health check endpoint, and only advances to the next wave once the service comes back healthy. Because waves run strictly in sequence and a failed health check stops the run, a bad OS update never cascades across the entire fleet. When every wave is patched, the flow reports completion to Slack. It solves the classic rolling-update problem: how to apply apt upgrade dist style patches at scale without taking down production all at once.
patch_waves task (io.kestra.plugin.core.flow.ForEach) iterates over the ordered waves input with concurrencyLimit: 1, forcing strictly sequential, one-wave-at-a-time execution.patch task (io.kestra.plugin.ansible.cli.AnsibleCLI) runs on the io.kestra.plugin.core.runner.Process runner. It writes an inventory.ini and a patch.yml playbook as inputFiles, then executes ansible-playbook -i inventory.ini patch.yml --limit {{ taskrun.value }} to apply OS updates via ansible.builtin.apt.health_check task (io.kestra.plugin.core.http.Request) issues a GET against health_check_url. A non-2xx response fails the task, which halts the loop before the next wave starts.notify task (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts a completion message including the wave count.Schedule trigger (cron: "0 2 8 * *") is included so you can switch on recurring patch windows when ready.Ansible runs a playbook, but it has no native scheduler, no event triggers, no retry policy, and no run history across waves. Kestra adds declarative YAML orchestration around your existing playbook: schedule patch windows or fire from external events, gate progression on a live HTTP health check, retry transient failures, and capture per-wave execution lineage and logs in one place. The ForEach with concurrencyLimit: 1 enforces the rolling-wave guarantee that Ansible alone cannot express, and downstream notifications keep your team informed without extra glue code.
patch task uses the Process runner.become: true) on the target hosts.SLACK_WEBHOOK_URL: Slack incoming webhook URL used by the notify task.SLACK_WEBHOOK_URL to your Kestra namespace secrets.inventory.ini placeholder with your real dynamic inventory source.waves and a health_check_url.monthly_patch Schedule trigger for recurring patch windows.ansible.builtin.apt task for yum, dnf, or a custom remediation playbook.patch and health_check for deeper validation.