Interview Prep/Ansible/YAML, Syntax and Jinja2 Errors

`ERROR! conflicting action statements: ansible.builtin.copy, dest`

IntermediateTroubleshootingYAML, Syntax and Jinja2 Errors
Answer

Likely causes → The module arguments are dedented to the task level, so Ansible sees copy and dest as two separate keys and tries to treat both as modules. A misspelled task keyword (notifiy:, whn:) gives the same error, because Ansible treats unknown keys as possible actions.

Diagnose → Look at the task the error points to:

- name: Copy config
  ansible.builtin.copy:
  src: app.conf        # wrong: same level as the module
  dest: /etc/app.conf

Fix → Indent the arguments under the module, and fix any misspelled keywords.

Prevent → ansible-lint catches both problems. Editor YAML schemas (the Red Hat Ansible VS Code extension) flag them as you type.

All Ansible questions Roadmap: Ansible

More on YAML, Syntax and Jinja2 Errors