# Unable to used the PBRUN command in Ansible

**URL:** <https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791>\
**Category:** Ansible Project\
**Created:** [September 28, 2021, 10:30am UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791 "2021-09-28T10:30:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shtrudhan\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Shtrudhan\_Kumar](https://forum.ansible.com/u/Shtrudhan_Kumar)\
**Post date:** [September 28, 2021, 10:30am UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/1 "2021-09-28T10:30:42Z")

</div>

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.

Regards  
Shtrudhan Kumar

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 28, 2021, 12:45pm UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/2 "2021-09-28T12:45:29Z")

</div>

I don’t see any playbook, or other content.  
What did you try already?  
What are you trying to automate?

On a side note, if you are new to ansible, what is the urgency about?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 28, 2021, 2:07pm UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/3 "2021-09-28T14:07:20Z")

</div>

I meant what does DISTRIB\_CODENAME evaluate to on the target system?

---

<div class="post-metadata">

**Author:** ![Neil\_Young](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@Neil\_Young](https://forum.ansible.com/u/Neil_Young)\
**Post date:** [September 28, 2021, 2:08pm UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/4 "2021-09-28T14:08:18Z")

</div>

“bionic” . All fine

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 28, 2021, 3:03pm UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/5 "2021-09-28T15:03:12Z")

</div>

Ha ok tiny hiccup.  
Glad it works.  
And in 3 lines!

---

<div class="post-metadata">

**Author:** ![Shtrudhan\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Shtrudhan\_Kumar](https://forum.ansible.com/u/Shtrudhan_Kumar)\
**Post date:** [September 29, 2021, 9:30am UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/6 "2021-09-29T09:30:02Z")

</div>

Thank you,

---

<div class="post-metadata">

**Author:** ![Gildas\_Cotomale](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gildas\_Cotomale](https://forum.ansible.com/u/Gildas_Cotomale)\
**Post date:** [October 8, 2021, 6:02am UTC](https://forum.ansible.com/t/unable-to-used-the-pbrun-command-in-ansible/35791/7 "2021-10-08T06:02:40Z")

</div>

Hello,

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)

Just few hints.  
Regards.
