Introducing AI agent: Get information about your infrastructure faster. Learn more >

Show notes: The agent is in - Episode 65 - Dispatching Ansible with CFEngine

Posted by Nick Anderson
September 24, 2026

We enjoyed Lars so much last time that we asked him to come back and show off some Ansible work he and Craig have been doing.

Lars demoed a hybrid CFEngine + Ansible workflow. Starting with two fresh hosts, he used an CFEngine Ansible Galaxy collection to install and bootstrap CFEngine with a playbook. Then he set up CFEngine Build with Craig’s install-ansible module to ensure Ansible is available everywhere via pipx, and then his new ansible-playbook-dispatcher module to upload, distribute, and locally execute Ansible playbooks across the fleet.

Why dispatch Ansible with CFEngine?

If you started with Ansible and your fleet grew, you may have hit the point where central push-based execution takes too long or becomes fragile over unreliable networks. A hybrid setup lets CFEngine handle what it’s good at (continuous local enforcement, convergence, reporting) while still running your existing Ansible playbooks.

The key advantage is that once the playbooks are distributed, the agent runs them locally even if the network goes down. If your hosts live on a ship, in a vehicle, or behind intermittent connectivity, they keep converging.

The demo

Lars walked through:

  1. Bootstrapping CFEngine with Ansible – Install the cfengine.cfengine collection from Ansible Galaxy and run a playbook that installs and bootstraps both a hub and a client. A wait_for task avoids the race condition where the client tries to bootstrap before cf-serverd is ready on the hub.

  2. Set up CFEngine Build – Create a cfbs project and add two modules:

    • install-ansible ensures Ansible is installed on all managed hosts via pipx.
    • ansible-playbook-dispatcher (Lars’ new module) lets you upload a playbook through the Build UI. It gets distributed and run locally on each host.
  3. Deploy and verify – After deploying the build project, running the update and agent on a client installs Ansible via pipx, creates a local inventory file, and executes the uploaded playbook.

Two ways to dispatch playbooks

The ansible-playbook-dispatcher module lets you upload playbook files directly through Mission Portal’s Build interface. The playbook content gets embedded in the build project and distributed to all hosts.

The run-ansible-playbooks module takes a different approach: instead of uploading files, you point it at a path where your playbooks already exist. It uses the same underlying ansible promise type but doesn’t prescribe how playbooks are distributed.

Both modules support a condition field for targeting specific hosts and an ifelapsed field to control how often playbooks run.

Video

The video recording is available on YouTube:

At the end of every webinar, we stop the recording for a nice and relaxed, off-the-record chat with attendees. Join the next webinar to not miss this discussion.