Hi Team,
i am new in Ansible. i have installed the Ansible core and my environment used pbrun bash to give the privallage access to the server and want to use the same in Ansible playbook. Could you guide me how to used this. This is urgent.
First, are you using the same account with the playbook and when you test interactively ?
And are you sure you are using the same “become_user” ?
Second, when your playbook run a task/module, it is using a clean minimal environment ?
Are you able to issue the same command in non interactive mode ? (for example from a cron/at/…)
If you have to do “pbrun bash” then the command, it’s not exactly the same as doing “pbrun thecommand” (what you are asking your playbook to do) You’re first loading a specific interpreter (and I’m not sure your playbook is using the same exact shell) in interactive session (hence setting environment variables and doing stuffs via the ~/.bashrc or ~/.profile etc)