`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.
More on YAML, Syntax and Jinja2 Errors
`Syntax Error while loading YAML. mapping values are not allowed in this context`Beginner`found character '\t' that cannot start any token`BeginnerAnsible says `This one looks easy to fix. It seems that there is a value started with a quote, and the YAML parser is expecting to see the line ended with the same kind of quote.`Beginner`We could be wrong, but this one looks like it might be an issue with missing quotes. Always quote template expression brackets when they start a value.`Beginner`ERROR! A malformed block was encountered while loading tasks: {...} should be a list or None but is <class 'ansible.parsing.yaml.objects.AnsibleMapping'>`Intermediate`ERROR! 'tsks' is not a valid attribute for a Play`Beginner