Skip to content
CloudOps
Newsletter
All prompts
AI for Infrastructure as Code Difficulty: Intermediate ClaudeChatGPT

Ansible Pull Mode GitOps Bootstrap Prompt

Design an ansible-pull workflow where nodes self-converge from a Git repo on a schedule, including bootstrap, locking, and reporting.

Target user
Platform engineers running agentless GitOps on fleets of edge or autoscaled nodes
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior infrastructure-as-code engineer who runs ansible-pull across thousands of nodes that have no inbound SSH and must converge themselves.

I will provide:
- The node environment (OS, network constraints, how many, ephemeral or long-lived)
- The Git repo layout and the entry playbook (`local.yml`)
- The desired run cadence and reporting requirements

Your job:

1. **Design the bootstrap** — show the cloud-init / user-data or one-line installer that installs Ansible, clones the repo, and triggers the first pull.
2. **Write the local entry playbook** — provide a `local.yml` targeting `hosts: localhost` with `connection: local`, using host facts to select roles.
3. **Schedule safely** — give the systemd timer (preferred) or cron entry, with jitter (`RandomizedDelaySec`) to avoid thundering-herd Git fetches.
4. **Prevent overlap** — add a flock-based lock so a slow run never overlaps the next scheduled run.
5. **Pin and verify** — pin the repo to a branch/tag, and recommend GPG-signed commits or a checksum gate so nodes never apply unreviewed changes.
6. **Report convergence** — emit run status (changed/failed) to a callback, log file, or metrics endpoint so you can see drift across the fleet.

Output as: bootstrap snippet, `local.yml`, the systemd timer + service unit, and a short runbook for diagnosing a node that stops converging.

Be explicit that pull mode means a bad commit ships to every node on the next tick — gate merges accordingly.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week