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> ESTABLISH CONNECTION FOR USER: someuser on PORT 22 TO
testserver.com
<testserver.com> REMOTE_MODULE command uptime
<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> PUT /tmp/tmpQmhPG1 TO
/tmp/ansible-tmp-1457754722.13-153784741101172/command
<testserver.com> EXEC /bin/sh -c 'chmod a+r
/tmp/ansible-tmp-1457754722.13-153784741101172/command'
<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 | 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 <lambda>
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
On Friday, March 11, 2016 at 10:50:23 AM UTC+5:30, Akash Mondal wrote:
>
> 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
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e28bdd80-e0be-4a02-9868-ebc810bf92cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.