`become_user` to an unprivileged account fails with "Failed to set permissions on the temporary files".
AdvancedScenarioSecurity: Vault, Become and Compliance
Answer
Situation read → Both users are unprivileged, so the temp module file isn't readable by become_user.
What I'd do → Enable pipelining (pipelining = True), which avoids temp files, or install acl so Ansible can use setfacl, or set allow_world_readable_tmpfiles = true (less secure).
[ssh_connection]
pipelining = True
Why → Without pipelining Ansible writes the module as login user and needs the become user to read it.
Interview tip → Pipelining requires requiretty to be off in sudoers.
More on Security: Vault, Become and Compliance
Database passwords are sitting in plain text in `group_vars`. How do you fix it?BeginnerYou need separate vault passwords for staging and prod.IntermediateHow do you change the vault password for all encrypted files?IntermediateA CI pipeline needs the vault password without storing it in the repo.IntermediateYou want to see the value inside an encrypted file without writing a decrypted copy to disk.BeginnerOnly one value in a vars file is secret and you want it in the same file as plain values.Beginner