79450848

Date: 2025-02-19 09:50:23
Score: 1
Natty:
Report link

I just want to add another possible reason why "root" is ignored as I encountered this issue as well but the problem was not with my inventory and I spent way more time than I wanted to resolve this issue:

Apparently the keyword "ansible_user" can also be overridden by group_vars/local_vars. I was following a tutorial which defined "ansible_user" as a group variable and didn't realize this can happen. It ended up taking precedence over even my "remote_user" definitions in my playbooks.

Moral of the story: don't use reserved keywords in your group_vars or local_vars unless you know what you are doing!

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: eltdrgntmr