Install
openclaw skills install ansibleAvoid common Ansible mistakes — YAML syntax traps, variable precedence, idempotence failures, and handler gotchas.
openclaw skills install ansible"{{ variable }}" not {{ variable }}: in string needs quotes — msg: "Note: this works" not msg: Note: thisyes, no, true, false parsed as bool — quote if literal string-e) override everything — highest precedencevars: in playbook beats inventory vars — order: inventory < playbook < extra vars{{ var | default('fallback') }}command/shell modules aren't idempotent — always "changed", use creates: or specific moduleapt, yum, copy etc. — designed for idempotencechanged_when: false for commands that don't change state — like queriescreates:/removes: for command idempotence — skips if file exists/doesn't--force-handlers to run even on failure — or meta: flush_handlersbecome: yes to run as root — become_user: for specific userbecome_method: sudo is default — use su or doas if needed--ask-become-pass or in ansible.cfgbecome: yeswhen: without Jinja2 braces — when: ansible_os_family == "Debian" not when: "{{ ... }}"and/or — or list for implicit andis defined, is not defined for optional vars — when: my_var is definedwhen: my_bool — don't compare == trueloop: is modern, with_items: is legacy — both work, loop preferredloop_control.loop_var for nested loops — avoids variable collisionitem is the loop variable — use loop_control.label for cleaner outputuntil: for retry loops — until: result.rc == 0 retries: 5 delay: 10gather_facts: no speeds up play — but can't use ansible_* variablesfact_caching — persists across runs/etc/ansible/facts.d/*.fact — JSON or INI, available as ansible_localregister: captures output even on failure — check result.rc or result.failedignore_errors: yes continues but doesn't change result — task still "failed" in registerdelegate_to: localhost for local commands — but local_action is cleaner--ask-vault-pass or vault password file--check (dry run) not supported by all modules — command, shell always skip