Member-only story
Ansible troubleshooting — Error 504: deprecated-local-action
How to Solve the Ansible Error 504 deprecated-local-action
Introduction
Ansible, the powerful automation and orchestration tool, is continually evolving to enhance its capabilities and streamline automation processes. To maintain efficient and up-to-date playbooks, it’s crucial to adhere to best practices and follow recommended guidelines. Ansible Lint Rule 504, known as “deprecated-local-action
,” addresses a practice that is no longer considered best practice in the Ansible ecosystem.
The Local Action Dilemma
In the realm of Ansible playbooks, local actions refer to tasks executed on the control node where Ansible is run. While there are scenarios where local actions are necessary, the Ansible community has shifted towards using a more structured and robust method for handling these tasks.
The problematic code that Ansible Rule 504 targets typically looks like this:
---
- name: Example of deprecated-local-action rule
hosts: all
tasks:
- name: Task example
local_action: # <-- this is deprecated
module: ansible.builtin.debug
In this code snippet, the local_action
key is used to specify a task to run on the…