ansible
Ansible
Overview
Use Ansible for repeatable, idempotent changes across nodes. Keep playbooks minimal, explicit about hosts, and safe to re-run.
When to use
- You need to apply the same change on multiple hosts.
- The change touches OS packages, services, or system config.
- You are bootstrapping or maintaining k3s, Rancher, or Tailscale on nodes.
Inventory and groups
Inventory lives in ansible/inventory/hosts.ini. Common groups:
kube_masters(k3s masters)kube_workers(k3s workers)k3s_cluster(masters + workers)proxy(nuc)docker_hosts(docker-host)
Quick start
Ping all nodes in the cluster:
ansible -i ansible/inventory/hosts.ini k3s_cluster -m ping -u kalmyk
Run a playbook on all nodes in the cluster:
ansible-playbook -i ansible/inventory/hosts.ini ansible/playbooks/install_nfs_client.yml -u kalmyk -b
Limit to a single host:
ansible-playbook -i ansible/inventory/hosts.ini ansible/playbooks/install_tailscale.yml -u kalmyk -b --limit kube-worker-00
Common playbooks in this repo
install_nfs_client.yml- install NFS client tools on nodesinstall_tailscale.yml- install Tailscale packagesstart_enable_tailscale.yml- enable and start tailscaledstart_enable_tailscale_client.yml- start Tailscale client servicesk3s-ha.yml- configure k3s HA clusterk3s-oidc.yml- configure OIDC for k3srancher2.yml- install Rancherwait_for_rancher.yml- wait until Rancher is readyrancher_bootstrap_logs.yml- capture Rancher bootstrap logsstart_rancher2_container.yml- start Rancher container
Safety and idempotency
- Prefer Ansible modules over shell commands.
- Use
--checkand--diffwhen validating a risky change. - Use
--limitto scope changes during testing. - Keep playbooks idempotent so re-runs are safe.
Validation
- Service check:
systemctl status tailscaled - Logs:
journalctl -u tailscaled --no-pager -n 50 - Cluster check:
kubectl get nodes -o wide
Resources
- Reference:
references/ansible-runbook.md - Runner:
scripts/run-playbook.sh - Template:
assets/playbook-template.yml
More from proompteng/lab
repo-map
Navigate this repo quickly to find the correct app, package, or service, and identify the right files for changes.
80memories
Save and retrieve memories or embeddings via the repo helpers or API. Use when working with embedding config or memory storage.
78temporal
Operate Temporal workflows in this repo: start/list/inspect workflows, fetch history, debug nondeterminism, reset/cancel/terminate, and check task queues via Temporal CLI.
77github-issue
Create GitHub issues in this repo using the Codex issue template and the gh CLI. Use when the user asks to file/open/create a GitHub issue, track work, or request a Codex implementation run via .github/ISSUE_TEMPLATE/codex-task.md.
76quality-checks
Run formatting, lint, typecheck, and tests for this repo; use when validating changes or investigating CI failures.
74gitops
GitOps workflows for this repo: edit Argo CD/Kubernetes/infra manifests in version control, validate changes, and rely on Argo CD to sync. Use when tasks touch argocd/, kubernetes/, tofu/, ansible/, or deployment/runbook changes, or when asked to roll out services via GitOps.
72