Warning while constructing a mapping in Ansible
Are you sure there is not more around the line 17? This warning is triggered when there are two identical keys in a task (or in general anywhere in a dict).
The warning claims there are two file
keys, suggesting the task looks like this:
- name: Clean temp files
file: ...
file: ...
A common mistake is that people forget to start a new list item for the next task. The following would be valid, while the above is not:
- name: Clean temp files
file: ...
- file: ...
I noticed Ansible sometimes gets the lines or even files wrong in error messages. I have seen it complaining about tasks/main.yml
while the problem actually was in handlers/main.yml
. If no such task with duplicate file
keys can be found near that line, search the whole file or even other files for it. If there is nothing like this anywhere to be found, then it would appear you found a bug in Ansible. In that case you should repot it on github.