Member-only story
Ansible troubleshooting — Error only-builtins
How to Solve the Ansible Error only-builtins Avoid Non-Builtin Actions
Avoid Non-Builtin Actions in Your Ansible Playbooks
In the realm of Ansible playbooks, maintaining consistency and simplicity is key to a successful automation strategy. One way to achieve this is by adhering to the “only-builtins” rule, which emphasizes the usage of built-in actions from the ansible.builtin
collection exclusively.
Keeping It Builtin
The “only-builtins
” rule acts as a guardrail to ensure that you don’t inadvertently wander into using non-built-in collections, plugins, or modules within your Ansible playbooks. While Ansible’s ecosystem is rich with various extensions, sticking to the built-in collection can streamline your playbook’s structure and maintainability.
Enable the only-builtins
Rule
You can enable this rule in your Ansible-lint configuration. By doing so, you instruct Ansible to validate only builtin modules.
Here’s how you can configure this rule:
enable_list:
- only-builtins
Problematic Code
---
- name: Example…