我正在用pbrun测试ansible。我们使用自己的凭据将其SSH到服务器,然后使用SSH进行身份验证,然后运行pbrun su-orasoa以能够安装oracle二进制文件和域。
我正在测试我的开发箱中的2个
inventory
[soa]
soaserver1.mycompany.com
soaserver2.mycompany.com
可用2.6.17
我的ansible.cfg
inventory = inventory
remote_user = oracl
ask_pass = True
host_key_checking = false
[privilege_escalation]
become=True
become_method=pbrun
become_user=orasoa
become_ask_pass=True
Ansible日志
<soaserver1.mycompany.com.hphc.org> ESTABLISH SSH CONNECTION FOR USER:
mmonter2
<soaserver1.mycompany.com.hphc.org> SSH: EXEC sshpass -d14 ssh -vvv -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
User=mmonter2 -o ConnectTimeout=10 -o
ControlPath=/home/orasoa/.ansible/cp/ae14ca51a1 -tt
soaserver1.mycompany.com.hphc.org '/bin/sh -c '"'"'pbrun -u orasoa
'"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-zarafuemqzepjtglwquygnwehlgwpkso;
/usr/bin/python /var/tmp/ansible-tmp-1571850508.16-
236952200511820/ping.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<soaserver1.mycompany.com.hphc.org> (0, '', 'OpenSSH_5.3p1, OpenSSL
1.0.1e-fips 11 Feb 2013\ndebug1: Reading configuration data
/etc/ssh/ssh_config\r\ndebug1: Applying options for *\r\ndebug1: auto-
mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2:
mux_client_hello_exchange: master version 4\r\ndebug3:
mux_client_request_forwards: requesting forwardings: 0 local, 0
remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3:
mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive:
done pid = 27594\r\ndebug3: mux_client_request_session: session request
sent\r\ndebug1: mux_client_request_session: master session id:
2\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3:
mux_client_read_packet: read header failed: Broken pipe\r\ndebug2:
Received exit status from master 0\r\n')
fatal: [soaserver1.mycompany.com.hphc.org]: FAILED! => changed=false
module_stderr: |-
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_request_forwards: requesting forwardings: 0 local, 0
remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 27594
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 127
Shared connection to soaserver1.mycompany.com.hphc.org closed.
module_stdout: |-
pbrun9.2.0-08[26134]: Request rejected by pbmasterd on lnlog004.hphc.org.
msg: MODULE FAILURE
rc: 127
答案 0 :(得分:0)
您是否在ansible.cfg {uncomment ssh_args}中尝试了此选项
[ssh_connection]
# ssh arguments to use
# Leaving off ControlPersist will result in poor performance, so use
# paramiko on older platforms rather than removing it, -C controls compression use
ssh_args = -C -o ControlMaster=auto -o ControlPersist=30m