Wednesday, February 28, 2018

Ansible Pbrun Issues

Symtom:
     Permission denied (publickey,password,keyboard-interactive).

Solution:
    Use flag -vvv to get detailed debug info
                   -k to get into interactive password input


Symtom:
     [WARNING]: Could not match supplied host pattern, ignoring:

Solution:
    Need to add your hostname into /etc/ansible/hosts
    see github link


Symtom:
     "pbrun9.3.0-07[12461]: Invalid command\r\n", ???

Solution:
-vvv to get details ssh command
  ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/hxie/.ansible/cp/1369acbeec -tt acmsdbv3084.us.oracle.com '/bin/sh -c '"'"'pbrun content -u oracle '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-gfjkhmsxjbzyupwkwnusqvetgeoinkwf; /usr/bin/python /tmp/ansible-tmp-1519878480.59-177960971664277/setup.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''

Test run and dig deeper  on the target host for exec command
   debug1: Sending command: /bin/sh -c 'pbrun content -u oracle '"'"'echo BECOME-SUCCESS-gfjkhmsxjbzyupwkwnusqvetgeoinkwf; /usr/bin/python /tmp/ansible-tmp-1519878480.59-177960971664277/setup.py'"'"' && sleep 0'
    Got the same error

So it is related how the pbrun server policy is setup. Some pbrun policies do not allow to run ssh command like above. Please contact your pbrun admin

GitHub addressed other similar issue

No comments: