Member-only story

Ansible troubleshooting — Error only-builtins

How to Solve the Ansible Error only-builtins Avoid Non-Builtin Actions

Luca Berton
3 min readNov 7, 2023

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…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet