So, I was reading https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#using-allow-duplicates-true trying to figure out what's going wrong with my playbook.
This playbook calls 9 roles, and 3 of them edit the same file (/etc/ssh/sshd_config). I can't consolidate all of them in a single one and easily fix the issue, two of the roles are maintained by other departments in the company and are downloaded on-demand by ansible-galaxy.
All of these 3 roles have a handler which will validate and restart ssh-server after everything else is finished (due to Ansible's execution order).
The problem is: no matter the role execution order I use, either moving them up or down, there is one of the roles which always gets 'overwritten'.
Does anyone understands how ansible treats multiple roles editing the same file, in terms of precedence? Which role should win? According to the documentation above, it should be the last one executed, correct? Can the handler (ssh restart) be interfering with the execution?
Please forgive me but I'm not allowed to paste the code here.