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.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Crossplane Composition Revision Rollout & Pinning Prompt
Roll out changes to a Crossplane Composition safely across many live claims — using CompositionRevisions, revision pinning, and automatic-vs-manual update policies so a bad composition change cannot ripple into every managed resource at once.
-
Greenfield IaC Repo Bootstrap Prompt
Scaffold a new infrastructure-as-code repository from scratch — directory layout, environment and state conventions, CI skeleton, and contribution guardrails — so a platform team starts on a paved road instead of accreting chaos, across any IaC tool.
-
Ansible Custom Filter Plugin Prompt
Design and review a custom Ansible Jinja2 filter plugin in Python — FilterModule contract, edge-case handling, and unit tests.
-
Ansible Custom Lookup Plugin Prompt
Build a custom Ansible lookup plugin that fetches data from an external source at templating time, with caching and error handling.
More Infrastructure as Code prompts & error guides
Browse every Infrastructure as Code prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.