Your question seems to be around “installing barman” (no idea what that is), and while doing that you run into some generic system administration issue.
Ansible is not really relevant to both the issues. It’s used to automate things, but that implies that you already know how to do those things.
The recommended approach is to first make “installing barman” work without ansible.
And when that was successful, automate the required steps using ansible.
This way lies madness, and a stack of security issues when someone or some process sticks alternative binaries or scripts for “ls” or “sh” in SOMETHING/sh. Also, as PATH becomes longer and longer from repeated such exercises, it can exceed the maximum PATH. It should be added to cautiously.
“Traverse /home” is also a non-starter in environments where home directories are auto-mounted or don’t live in /home/ for particular users, and tools like the “barman” software for PostgreSQL backups have their own fascinating habit of shoving components in $HOME/ that need to be completed for each user.
May I suggest thoughtfully activating such changes only as needed for particular users, perhaps as part of the “barman” setup for those users?
I did something quite similar (for one particular user).
As I am pushing a .bashrc up to the target anyway at some point I added my PATH in the same manner you suggets here via the edit Module.