Hi Brian Thanks very much for these hints. I did some more reading in https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_privilege_escalation.html and its linked pages. I found that adding:
become_method: su allowed 'printenv' to run correctly in the non-root account, and the further addition of: become_flags: '-' allowed execution of .bash_profile, allowing the environment variables to be set. Thanks again tl On Thursday, September 28, 2023 at 2:39:36 PM UTC-4 Brian Coca wrote: > become does not always imply a full login nor sourcing .shell files, > some of it depends on flags (`-i` for sudo or `-` for su), other times > it depends on shell used. > > -- > ---------- > Brian Coca > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/424ae6f9-5dc3-424e-83a6-26f09ab91b05n%40googlegroups.com.
