# Having trouble with running commands as pbrun escalation method

**URL:** <https://forum.ansible.com/t/having-trouble-with-running-commands-as-pbrun-escalation-method/20837>\
**Category:** Ansible Project\
**Created:** [March 11, 2016, 2:50am UTC](https://forum.ansible.com/t/having-trouble-with-running-commands-as-pbrun-escalation-method/20837 "2016-03-11T02:50:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akash\_Mondal](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Akash\_Mondal](https://forum.ansible.com/u/Akash_Mondal)\
**Post date:** [March 11, 2016, 2:50am UTC](https://forum.ansible.com/t/having-trouble-with-running-commands-as-pbrun-escalation-method/20837/1 "2016-03-11T02:50:14Z")

</div>

anybody had success with running basic commands using pbrun escalation method? For example I tried below command but it is not working for me.

ansible testserv -i /etc/ansible/testserv -a “uptime” -u someuser -k --become-method=pbrun --become-user=‘sa -u root’ --ask-become-pass -vvvv

Any help is really appreciated.

Thanks  
Akash

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 11, 2016, 4:34pm UTC](https://forum.ansible.com/t/having-trouble-with-running-commands-as-pbrun-escalation-method/20837/2 "2016-03-11T16:34:55Z")

</div>

yes, there are a few people using pbrun, your command looks fine but w/o an error I’m not sure what ‘not working’ means.

---

<div class="post-metadata">

**Author:** ![Akash\_Mondal](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Akash\_Mondal](https://forum.ansible.com/u/Akash_Mondal)\
**Post date:** [March 12, 2016, 4:10am UTC](https://forum.ansible.com/t/having-trouble-with-running-commands-as-pbrun-escalation-method/20837/3 "2016-03-12T04:10:59Z")

</div>

Hi Brian,

Thanks for your response. In a normal scenario, I login using ldap user “someuser” and then become root using “pbrun sa -u root” power broker policy. I want to perform root specific tasks with ansible and my organization does not support sudo or su. At the moment I am a beginner with ansible. Please find the command below with verbose output.

# ansible testserv -i /etc/ansible/testserv -a “uptime” -u someuser -k --become-method=pbrun --become-user=‘sa -u root’ --ask-become-pass -vvvv

SSH password:  
PBRUN password[defaults to SSH password]:  
\<[testserver.com](http://testserver.com)\> ESTABLISH CONNECTION FOR USER: someuser on PORT 22 TO [testserver.com](http://testserver.com)  
\<[testserver.com](http://testserver.com)\> REMOTE\_MODULE command uptime  
\<[testserver.com](http://testserver.com)\> EXEC /bin/sh -c ‘mkdir -p /tmp/ansible-tmp-1457754722.13-153784741101172 && chmod a+rx /tmp/ansible-tmp-1457754722.13-153784741101172 && echo /tmp/ansible-tmp-1457754722.13-153784741101172’  
\<[testserver.com](http://testserver.com)\> PUT /tmp/tmpQmhPG1 TO /tmp/ansible-tmp-1457754722.13-153784741101172/command  
\<[testserver.com](http://testserver.com)\> EXEC /bin/sh -c ‘chmod a+r /tmp/ansible-tmp-1457754722.13-153784741101172/command’  
\<[testserver.com](http://testserver.com)\> EXEC /bin/sh -c ‘pbrun -b -u sa -u root "’“'”‘echo BECOME-SUCCESS-rhppcyrbglnovowddwgdpbpdkgdsawtt; LANG=C LC\_CTYPE=C /usr/bin/python /tmp/ansible-tmp-1457754722.13-153784741101172/command’“'”‘"’  
[testserver.com](http://testserver.com) | FAILED =\> ssh connection closed waiting for password prompt  
Unhandled exception in thread started by \<bound method Transport.\_\_bootstrap of \<paramiko.Transport at 0x2e47050L (unconnected)\>\>  
Error in sys.excepthook:  
Traceback (most recent call last):  
File “/usr/lib64/python2.6/site-packages/abrt\_exception\_handler.py”, line 204, in   
sys.excepthook = lambda etype, value, tb: handleMyException((etype, value, tb))  
TypeError: ‘NoneType’ object is not callable

Original exception was:  
Traceback (most recent call last):  
File “/usr/lib64/python2.6/threading.py”, line 504, in \_\_bootstrap  
self.\_\_bootstrap\_inner()  
File “/usr/lib64/python2.6/threading.py”, line 545, in \_\_bootstrap\_inner  
(self.name, \_format\_exc()))  
File “/usr/lib64/python2.6/traceback.py”, line 241, in format\_exc  
etype, value, tb = sys.exc\_info()  
AttributeError: ‘NoneType’ object has no attribute ‘exc\_info’

Below is my ansible.cfg for suing escalation method.

[privilege\_escalation]  
become=True  
#become\_method=‘sudo’  
become\_user=‘root’  
#become\_ask\_pass=False  
become\_method=‘pbrun’  
#become\_exe=‘pbrun sa’

Regards,  
Akash
