Team, Can someone sort this out please… We are using 2.8.18 version of ansible on our control node.
I am facing error when trying to perform ping-pong with ansible as become_user root (as pasted below). On the remote server, the user is having access to run sudo commands and user can become root by running sudo su -
(with become disabled, connection is working fine to any remote_user)
Error -------------------_>
1x.xx.xxx.xx | FAILED! => {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“changed”: false,
“module_stderr”: “OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request 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 = 31364\r\ndebug3: mux_client_request_session: session request sent\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 1\r\nShared connection to 1x.xx.xxx.xx closed.\r\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
I have used the below privilege escalation and tried ssh_connection parameters in ansible config file
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=True
[ssh_connection]
ssh_args=‘-C -o ControlMaster=auto -o ControlPersist=60s’
pipelining=False