Hello,
I found a role in galaxy and it’s creating config files for a service. The author was running it without sudo. When I run it with sudo, the config files (created by template module) are owned by the ansible_ssh_user rather than root. They need to be owned by root. I was thinking to add “owner: root” to all the template resources in the role, but then I thought it might be better to specify it only once, and make root the default owner somehow in order to not to repeat myself.
Is it possible to specify default owner for all the files or templates in a role somehow?
How I would expect it to work: In /defaults/main.yml, I’d set “template.owner: root”. The resources would then be root-owned unless specified otherwise.
Cheers,
Tomas