Provide guidelines on how to develop Ansible playbooks that are compliant with project standards. Should be used when generating, modifying, or reviewing Ansible playbooks, roles, or collections.
This skill provides guidelines on how to develop Ansible playbooks that are compliant with project standards. Should be used when generating, modifying, or reviewing Ansible playbooks, roles, or collections.
If the Ansible playbook, role, or collection being developed has existing examples in the project repository, always refer to those examples and mimic their style and structure to ensure consistency.
If there are no existing examples in the project repository, refer to the following guidelines:
The following structure should be followed for each task in the Ansible playbook:
when key should be placed at the start of the task, right after the name key.become key is used, it should be placed right after the key.whenbecome key is mandatory for tasks that require elevated privileges.ansible_facts prefix (e.g., ansible_facts['os_family'] instead of ansible_os_family).loop instead of with_items for iterating over lists.loop_control for better readability.true and false for boolean values.