Skip to content

deprecated-local-action

This rule recommends using delegate_to: localhost instead of the local_action.

Problematic Code

---
- name: Task example
  local_action: # <-- this is deprecated
    module: ansible.builtin.debug

Correct Code

- name: Task example
    ansible.builtin.debug:
  delegate_to: localhost # <-- recommended way to run on localhost

Note

This rule can be automatically fixed using --fix option.