Docker sources are not idempotent
If an existing docker.list source exists with differing content from the generated source, the docker playbook will not overwrite it. Instead it will simply append the new entry to the same file.
Steps to repeat the issue
- Create docker.list file at
/etc/apt/sources.list.d/docker.list
- Populate with some source entry content (deb [arch=amd64,i386] https://download.docker.com/example jammy stable)
- Run the playbook
Expected result
The docker.list file will be overwritten with the new source entry content.
Actual result
It will append a new source entry to the same file which usually results in conflicting apt sources