Interview Prep/Ansible/Security: Vault, Become and Compliance

`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.

All Ansible questions Roadmap: Ansible

More on Security: Vault, Become and Compliance