become or sudo

Hi All,

I am facing issue while installing httpd into remote server from ansible control server.

I have a control machine and a webserver machine.
My playbook is given below

The OS report that you don't have the permission, how does the you entry in sudoers look like?
Ansible need unrestricted sudo access to work[1].

[1] https://docs.ansible.com/ansible/latest/user_guide/become.html#can-t-limit-escalation-to-certain-commands

Hi Kai,

I have assigned wheel group to the user “rajrawat”

The next step would be to run ansible-playbook with -vvvv and see if that gives any clues.

Hi Kai,

I have ran the playbook with -vvvv option.

Output is as below .

ansible-playbook 2.6.4
config file = /etc/ansible/ansible.cfg
configured module search path = [u’/scratch/rajrawat/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible-playbook
python version = 2.7.5 (default, May 8 2014, 17:35:19) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)]
Using /etc/ansible/ansible.cfg as config file
SUDO password:
setting up inventory plugins
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: userTest.yml **************************************************************************************************************************************
1 plays in userTest.yml

PLAY [xyz.com] *******************************************************************************************************************************

TASK [Gathering Facts] **************************************************************************************************************************************
task path: /scratch/app/product/ansible/secretTest/userTest.yml:2
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘echo ~rajrawat && sleep 0’”’“‘’
<xyz.com> (0, ‘/scratch/rajrawat\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: Applying options for \r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket “/scratch/rajrawat/.ansible/cp/3af502ab58” does not exist\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to xyz.com [10.184.157.255] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug3: Incorrect RSA1 identifier\r\ndebug3: Could not load “/scratch/rajrawat/.ssh/id_rsa” as a RSA1 public key\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_rsa type 1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_dsa type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_ecdsa type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_ed25519 type -1\r\ndebug1: identity file /scratch/rajrawat/.ssh/id_ed25519-cert type -1\r\ndebug1: Enabling compatibility mode for protocol 2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH_6.6.1\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1\r\ndebug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1 compat 0x04000000\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug3: load_hostkeys: loading entries for host “xyz.com” from file “/scratch/rajrawat/.ssh/known_hosts”\r\ndebug3: load_hostkeys: found key type ECDSA in file /scratch/rajrawat/.ssh/known_hosts:7\r\ndebug3: load_hostkeys: loaded 1 keys\r\ndebug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dss\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: zlib@openssh.com,zlib,none\r\ndebug2: kex_parse_kexinit: zlib@openssh.com,zlib,none\r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: first_kex_follows 0 \r\ndebug2: kex_parse_kexinit: reserved 0 \r\ndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com\r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: first_kex_follows 0 \r\ndebug2: kex_parse_kexinit: reserved 0 \r\ndebug2: mac_setup: setup hmac-md5-etm@openssh.com\r\ndebug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com zlib@openssh.com\r\ndebug2: mac_setup: setup hmac-md5-etm@openssh.com\r\ndebug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com zlib@openssh.com\r\ndebug1: kex: curve25519-sha256@libssh.org need=16 dh_need=16\r\ndebug1: kex: curve25519-sha256@libssh.org need=16 dh_need=16\r\ndebug1: sending SSH2_MSG_KEX_ECDH_INIT\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug1: Server host key: ECDSA b4:7e:ed:f2:87:f2:d5:05:70:a3:31:29:75:2d:c5:df\r\ndebug3: load_hostkeys: loading entries for host “xyz.com” from file “/scratch/rajrawat/.ssh/known_hosts”\r\ndebug3: load_hostkeys: found key type ECDSA in file /scratch/rajrawat/.ssh/known_hosts:7\r\ndebug3: load_hostkeys: loaded 1 keys\r\ndebug3: load_hostkeys: loading entries for host “10.184.157.255” from file “/scratch/rajrawat/.ssh/known_hosts”\r\ndebug3: load_hostkeys: found key type ECDSA in file /scratch/rajrawat/.ssh/known_hosts:7\r\ndebug3: load_hostkeys: loaded 1 keys\r\ndebug1: Host 'xyz.com' is known and matches the ECDSA host key.\r\ndebug1: Found key in /scratch/rajrawat/.ssh/known_hosts:7\r\ndebug1: ssh_ecdsa_verify: signature correct\r\ndebug2: kex_derive_keys\r\ndebug2: set_newkeys: mode 1\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug2: set_newkeys: mode 0\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug1: Roaming not allowed by server\r\ndebug1: SSH2_MSG_SERVICE_REQUEST sent\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug2: key: /scratch/rajrawat/.ssh/id_rsa (0x55d38da2dc90),\r\ndebug2: key: /scratch/rajrawat/.ssh/id_dsa ((nil)),\r\ndebug2: key: /scratch/rajrawat/.ssh/id_ecdsa ((nil)),\r\ndebug2: key: /scratch/rajrawat/.ssh/id_ed25519 ((nil)),\r\ndebug1: Authentications that can continue: publickey,password\r\ndebug3: start over, passed a different list publickey,password\r\ndebug3: preferred gssapi-with-mic,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: ,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Offering RSA public key: /scratch/rajrawat/.ssh/id_rsa\r\ndebug3: send_pubkey_test\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug1: Server accepts key: pkalg ssh-rsa blen 279\r\ndebug2: input_userauth_pk_ok: fp 13:e7:56:64:85:4c:68:74:a9:3f:04:bd:25:f0:62:2f\r\ndebug3: sign_and_send_pubkey: RSA 13:e7:56:64:85:4c:68:74:a9:3f:04:bd:25:f0:62:2f\r\ndebug1: key_parse_private2: missing begin marker\r\ndebug1: read PEM private key done: type RSA\r\ndebug1: Enabling compression at level 6.\r\ndebug1: Authentication succeeded (publickey).\r\nAuthenticated to xyz.com ([10.184.157.255]:22).\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver_listen: temporary control path /scratch/rajrawat/.ansible/cp/3af502ab58.dQoDFwsAfpI9tSKF\r\ndebug2: fd 5 setting O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug1: channel 0: new [/scratch/rajrawat/.ansible/cp/3af502ab58]\r\ndebug3: muxserver_listen: mux listener channel 0 fd 5\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug3: packet_set_tos: set IP_TOS 0x08\r\ndebug1: control_persist_detach: backgrounding master process\r\ndebug2: control_persist_detach: background process is 1723\r\ndebug2: fd 5 setting O_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug2: fd 6 setting O_NONBLOCK\r\ndebug3: fd 6 is O_NONBLOCK\r\ndebug1: channel 1: new [mux-control]\r\ndebug3: channel_post_mux_listener: new mux channel 1 fd 6\r\ndebug3: mux_master_read_cb: channel 1: hello sent\r\ndebug2: set_control_persist_exit_time: cancel scheduled exit\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: process_mux_master_hello: channel 1 slave version 4\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_master_read_cb: channel 1 packet type 0x10000004 len 4\r\ndebug2: process_mux_alive_check: channel 1: alive check\r\ndebug3: mux_client_request_alive: done pid = 1730\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 98\r\ndebug2: process_mux_new_session: channel 1: request tty 0, X 1, agent 0, subsys 0, term “xterm”, cmd “/bin/sh -c 'echo ~rajrawat && sleep 0'”, env 1\r\ndebug3: process_mux_new_session: got fds stdin 7, stdout 8, stderr 9\r\ndebug2: fd 8 setting O_NONBLOCK\r\ndebug2: fd 9 setting O_NONBLOCK\r\ndebug1: channel 2: new [client-session]\r\ndebug2: process_mux_new_session: channel_new: 2 linked to control channel 1\r\ndebug2: channel 2: send open\r\ndebug2: callback start\r\ndebug2: client_session2_setup: id 2\r\ndebug1: Sending environment.\r\ndebug1: Sending env LANG = en_US.UTF-8\r\ndebug2: channel 2: request env confirm 0\r\ndebug1: Sending command: /bin/sh -c 'echo ~rajrawat && sleep 0'\r\ndebug2: channel 2: request exec confirm 1\r\ndebug3: mux_session_confirm: sending success reply\r\ndebug2: callback done\r\ndebug2: channel 2: open confirm rwindow 0 rmax 32768\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: channel 2: rcvd adjust 2097152\r\ndebug2: channel_input_status_confirm: type 99 id 2\r\ndebug2: exec request accepted on channel 2\r\ndebug1: client_input_channel_req: channel 2 rtype exit-status reply 0\r\ndebug3: mux_exit_message: channel 2: exit message, exitval 0\r\ndebug1: client_input_channel_req: channel 2 rtype eow@openssh.com reply 0\r\ndebug2: channel 2: rcvd eow\r\ndebug2: channel 2: close_read\r\ndebug2: channel 2: input open → closed\r\ndebug2: channel 2: rcvd eof\r\ndebug2: channel 2: output open → drain\r\ndebug2: channel 2: obuf empty\r\ndebug2: channel 2: close_write\r\ndebug2: channel 2: output drain → closed\r\ndebug2: channel 2: rcvd close\r\ndebug3: channel 2: will not send data after close\r\ndebug2: channel 2: send close\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: gc: notify user\r\ndebug3: mux_master_session_cleanup_cb: entering for channel 2\r\ndebug2: channel 1: rcvd close\r\ndebug2: channel 1: output open → drain\r\ndebug2: channel 1: close_read\r\ndebug2: channel 1: input open → closed\r\ndebug2: channel 2: gc: user detached\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: garbage collecting\r\ndebug1: channel 2: free: client-session, nchannels 3\r\ndebug3: channel 2: status: The following connections are open:\r\n #2 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n\r\ndebug2: channel 1: obuf empty\r\ndebug2: channel 1: close_write\r\ndebug2: channel 1: output drain → closed\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: gc: notify user\r\ndebug3: mux_master_control_cleanup_cb: entering for channel 1\r\ndebug2: channel 1: gc: user detached\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: garbage collecting\r\ndebug1: channel 1: free: mux-control, nchannels 2\r\ndebug3: channel 1: status: The following connections are open:\r\n\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com '/bin/sh -c '”‘"’( umask 77 && mkdir -p “echo /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045” && echo ansible-tmp-1538642299.22-41934610843045=“echo /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045” ) && sleep 0’“'”‘’
<xyz.com> (0, ‘ansible-tmp-1538642299.22-41934610843045=/scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<xyz.com> PUT /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpxDPF3_ TO /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/setup.py
<xyz.com> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 ‘[xyz.com]’
<xyz.com> (0, ‘sftp> put /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpxDPF3_ /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/setup.py\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “posix-rename@openssh.com” revision 1\r\ndebug2: Server supports extension “statvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “fstatvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “hardlink@openssh.com” revision 1\r\ndebug2: Server supports extension “fsync@openssh.com” revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . → /scratch/rajrawat size 0\r\ndebug3: Looking up /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpxDPF3_\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn't stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/setup.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:8 O:131072 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:9 O:163840 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:10 O:196608 S:12999\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 32768 bytes at 98304\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 8 32768 bytes at 131072\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 9 32768 bytes at 163840\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 10 12999 bytes at 196608\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘chmod u+x /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/ /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/setup.py && sleep 0’”’“‘’
<xyz.com> (0, ‘’, 'OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 -tt xyz.com ‘/bin/sh -c ‘"’"’/usr/bin/python /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/setup.py && sleep 0’“'”‘’
<xyz.com> (0, '\r\n{“invocation”: {“module_args”: {“filter”: "
”, “gather_subset”: [“all”], “fact_path”: “/etc/ansible/facts.d”, “gather_timeout”: 10}}, “ansible_facts”: {“ansible_userspace_architecture”: “x86_64”, “ansible_product_serial”: “NA”, “ansible_form_factor”: “Other”, “ansible_user_gecos”: “”, “ansible_distribution_file_parsed”: true, “ansible_fips”: false, “ansible_service_mgr”: “systemd”, “ansible_user_id”: “rajrawat”, “ansible_selinux_python_present”: true, “ansible_userspace_bits”: “64”, “ansible_ssh_host_key_rsa_public”: “AAAAB3NzaC1yc2EAAAADAQABAAABAQDMNLNRqw/ALK5iITBuyQf3hdlEXFSalBeLXJj6pAEdrO+2k+gASfCtE02VjgtxfhZ9ecbX0oNpgbr+ORDIfPqh1W2dm4RXJUsHWFmsMcyA4DIu88ErN00DarjCAiOABl5z+HoyoZpQAORDD+Kc3m5VNwFUUZ8ePM0VOywYjF/y4Cif9+rEa7nfEQ4Ah3L0Isr+XzbPFBpWQHXNm2SN7peHVB2Dz7+27z5Cs2gGZq/uP5GAuZWI9e3qLO41367wEeOxhb5RMKEg97ySy4t0JAJQ4BXUaxPsCQEiL4KnGMKM6+Exa0Ftxe7Do4twOVQ3inWn1WpNNGcdFqmmmEnrMcLb”, “gather_subset”: [“all”], “ansible_real_user_id”: 10102, “ansible_architecture”: “x86_64”, “ansible_local”: {}, “ansible_distribution_version”: “7.3”, “ansible_domain”: “.com”, “ansible_distribution_file_path”: “/etc/oracle-release”, “ansible_user_shell”: “/bin/bash”, “ansible_virtualization_type”: “xen”, “ansible_ssh_host_key_ed25519_public”: “AAAAC3NzaC1lZDI1NTE5AAAAIFG2Rl3lFj/nrEwXlH2RiGxgRxaoR3y7t9d60Q9hRTRS”, “ansible_processor_cores”: 4, “ansible_virtualization_role”: “guest”, “ansible_distribution_file_variety”: “OracleLinux”, “ansible_dns”: {“nameservers”: [“10.121.31.25”, “#Preferred”, “PE&O”, “India”, “primary”, “10.121.30.45”, “#Secondary”, “PE&O”, “India”, “Secondary”, “10.176.48.6”, “#”, “Tertiary”, “PE&O”, “India”, “DR”, “Hyderbad”, “206.223.27.1”, “#Corp”, “Anycast”], “search”: [“.com”, “us.com”, “.com”, “.com”, “idc.com”], “options”: {“attempts”: “2”, “timeout”: “1”}}, “ansible_effective_group_id”: 59968, “ansible_is_chroot”: false, “ansible_docker0”: {“macaddress”: “02:42:19:f1:25:ce”, “features”: {“tx_checksum_ipv4”: “off [fixed]”, “generic_receive_offload”: “on”, “tx_checksum_ipv6”: “off [fixed]”, “tx_scatter_gather_fraglist”: “on”, “rx_all”: “off [fixed]”, “highdma”: “on”, “rx_fcs”: “off [fixed]”, “tx_lockless”: “on [fixed]”, “tx_tcp_ecn_segmentation”: “on”, “tx_tcp6_segmentation”: “on”, “tx_gso_robust”: “on”, “tx_ipip_segmentation”: “on”, “tx_checksumming”: “on”, “vlan_challenged”: “off [fixed]”, “hw_switch_offload”: “off [fixed]”, “loopback”: “off [fixed]”, “fcoe_mtu”: “off [fixed]”, “tx_checksum_sctp”: “off [fixed]”, “tx_vlan_stag_hw_insert”: “on”, “rx_vlan_stag_hw_parse”: “off [fixed]”, “rx_vlan_stag_filter”: “off [fixed]”, “large_receive_offload”: “off [fixed]”, “tx_scatter_gather”: “on”, “rx_checksumming”: “off [fixed]”, “tx_tcp_segmentation”: “on”, “netns_local”: “on [fixed]”, “busy_poll”: “off [fixed]”, “generic_segmentation_offload”: “on”, “tx_udp_tnl_segmentation”: “on”, “tcp_segmentation_offload”: “on”, “l2_fwd_offload”: “off [fixed]”, “rx_vlan_offload”: “off [fixed]”, “ntuple_filters”: “off [fixed]”, “tx_vlan_offload”: “on”, “tx_nocache_copy”: “off”, “udp_fragmentation_offload”: “on”, “scatter_gather”: “on”, “tx_sit_segmentation”: “on”, “tx_checksum_fcoe_crc”: “off [fixed]”, “tx_checksum_ip_generic”: “on”, “tx_fcoe_segmentation”: “on”, “rx_vlan_filter”: “off [fixed]”, “receive_hashing”: “off [fixed]”, “tx_gre_segmentation”: “on”}, “interfaces”: , “id”: “8000.024219f125ce”, “mtu”: 1500, “device”: “docker0”, “promisc”: false, “stp”: false, “ipv4”: {“broadcast”: “global”, “netmask”: “255.255.0.0”, “network”: “172.17.0.0”, “address”: “172.17.0.1”}, “active”: false, “timestamping”: [“rx_software”, “software”], “type”: “bridge”, “hw_timestamp_filters”: }, “ansible_bios_version”: “4.1.3OVM”, “ansible_processor”: [“0”, “GenuineIntel”, “Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz”, “1”, “GenuineIntel”, “Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz”, “2”, “GenuineIntel”, “Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz”, “3”, “GenuineIntel”, “Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz”], “ansible_date_time”: {“weekday_number”: “4”, “iso8601_basic_short”: “20181004T013821”, “tz”: “PDT”, “weeknumber”: “40”, “hour”: “01”, “year”: “2018”, “minute”: “38”, “tz_offset”: “-0700”, “month”: “10”, “epoch”: “1538642301”, “iso8601_micro”: “2018-10-04T08:38:21.395762Z”, “weekday”: “Thursday”, “time”: “01:38:21”, “date”: “2018-10-04”, “iso8601”: “2018-10-04T08:38:21Z”, “day”: “04”, “iso8601_basic”: “20181004T013821395664”, “second”: “21”}, “ansible_lo”: {“features”: {“tx_checksum_ipv4”: “off [fixed]”, “generic_receive_offload”: “on”, “tx_checksum_ipv6”: “off [fixed]”, “tx_scatter_gather_fraglist”: “on [fixed]”, “rx_all”: “off [fixed]”, “highdma”: “on [fixed]”, “rx_fcs”: “off [fixed]”, “tx_lockless”: “on [fixed]”, “tx_tcp_ecn_segmentation”: “on”, “tx_tcp6_segmentation”: “on”, “tx_gso_robust”: “off [fixed]”, “tx_ipip_segmentation”: “off [fixed]”, “tx_checksumming”: “on”, “vlan_challenged”: “on [fixed]”, “hw_switch_offload”: “off [fixed]”, “loopback”: “on [fixed]”, “fcoe_mtu”: “off [fixed]”, “tx_checksum_sctp”: “on [fixed]”, “tx_vlan_stag_hw_insert”: “off [fixed]”, “rx_vlan_stag_hw_parse”: “off [fixed]”, “rx_vlan_stag_filter”: “off [fixed]”, “large_receive_offload”: “off [fixed]”, “tx_scatter_gather”: “on [fixed]”, “rx_checksumming”: “on [fixed]”, “tx_tcp_segmentation”: “on”, “netns_local”: “on [fixed]”, “busy_poll”: “off [fixed]”, “generic_segmentation_offload”: “on”, “tx_udp_tnl_segmentation”: “off [fixed]”, “tcp_segmentation_offload”: “on”, “l2_fwd_offload”: “off [fixed]”, “rx_vlan_offload”: “off [fixed]”, “ntuple_filters”: “off [fixed]”, “tx_vlan_offload”: “off [fixed]”, “tx_nocache_copy”: “off [fixed]”, “udp_fragmentation_offload”: “on”, “scatter_gather”: “on”, “tx_sit_segmentation”: “off [fixed]”, “tx_checksum_fcoe_crc”: “off [fixed]”, “tx_checksum_ip_generic”: “on [fixed]”, “tx_fcoe_segmentation”: “off [fixed]”, “rx_vlan_filter”: “off [fixed]”, “receive_hashing”: “off [fixed]”, “tx_gre_segmentation”: “off [fixed]”}, “hw_timestamp_filters”: , “mtu”: 65536, “device”: “lo”, “promisc”: false, “timestamping”: [“rx_software”, “software”], “ipv4”: {“broadcast”: “host”, “netmask”: “255.0.0.0”, “network”: “127.0.0.0”, “address”: “127.0.0.1”}, “ipv6”: [{“scope”: “host”, “prefix”: “128”, “address”: “::1”}], “active”: true, “type”: “loopback”}, “ansible_memtotal_mb”: 14915, “ansible_ssh_host_key_ecdsa_public”: “AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBF0Vuw6/ullyiTdTHwiOLdPUQZbaqBSML/NqE8c0cwgTjL3roO7h8z58BXm16PHLhs/qVhms6zT32qetYB+Fqw=”, “ansible_device_links”: {“masters”: {}, “labels”: {“xvda5”: [“docker”]}, “ids”: {}, “uuids”: {“xvda5”: [“d6784705-7bc2-4d17-9aa9-301e6b3b05ea”], “xvda6”: [“05a976cb-f921-43c1-979e-75f6952cab7b”], “xvda1”: [“4eb964c9-4f14-4445-b998-f98edc8d1fa7”], “xvda2”: [“dd2ac417-d452-48c9-a776-ac0e288b7ac0”], “xvda3”: [“2ef9af08-500a-449b-8640-e3f2a2ab5182”]}}, “ansible_default_ipv4”: {“macaddress”: “00:21:f6:46:17:5d”, “network”: “10.184.156.0”, “mtu”: 1500, “broadcast”: “10.184.159.255”, “alias”: “eth0”, “netmask”: “255.255.252.0”, “address”: “10.184.157.255”, “interface”: “eth0”, “type”: “ether”, “gateway”: “10.184.156.1”}, “ansible_swapfree_mb”: 15616, “ansible_default_ipv6”: {}, “ansible_distribution_release”: “NA”, “ansible_system_vendor”: “Xen”, “ansible_os_family”: “RedHat”, “ansible_cmdline”: {“LANG”: “en_US.UTF-8”, “BOOT_IMAGE”: “/vmlinuz-4.1.12-124.19.5.el7uek.x86_64”, “ro”: true, “root”: “UUID=2ef9af08-500a-449b-8640-e3f2a2ab5182”, “crashkernel”: “auto”}, “ansible_effective_user_id”: 10102, “ansible_user_gid”: 59968, “ansible_selinux”: {“status”: “disabled”}, “ansible_product_version”: “4.1.3OVM”, “ansible_apparmor”: {“status”: “disabled”}, “ansible_distribution_file_search_string”: “Oracle Linux”, “ansible_product_uuid”: “NA”, “ansible_system”: “Linux”, “ansible_pkg_mgr”: “yum”, “ansible_memfree_mb”: 5524, “ansible_devices”: {“xvda”: {“scheduler_mode”: “”, “rotational”: “0”, “vendor”: null, “sectors”: “503316480”, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: }, “sas_device_handle”: null, “sas_address”: null, “virtual”: 1, “host”: “”, “sectorsize”: “512”, “removable”: “0”, “support_discard”: “0”, “model”: null, “partitions”: {“xvda4”: {“sectorsize”: 512, “uuid”: null, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: }, “sectors”: “2”, “start”: “442499072”, “holders”: , “size”: “1.00 KB”}, “xvda5”: {“sectorsize”: 512, “uuid”: “d6784705-7bc2-4d17-9aa9-301e6b3b05ea”, “links”: {“masters”: , “labels”: [“docker”], “ids”: , “uuids”: [“d6784705-7bc2-4d17-9aa9-301e6b3b05ea”]}, “sectors”: “50331648”, “start”: “442501120”, “holders”: , “size”: “24.00 GB”}, “xvda6”: {“sectorsize”: 512, “uuid”: “05a976cb-f921-43c1-979e-75f6952cab7b”, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: [“05a976cb-f921-43c1-979e-75f6952cab7b”]}, “sectors”: “10481664”, “start”: “492834816”, “holders”: , “size”: “5.00 GB”}, “xvda1”: {“sectorsize”: 512, “uuid”: “4eb964c9-4f14-4445-b998-f98edc8d1fa7”, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: [“4eb964c9-4f14-4445-b998-f98edc8d1fa7”]}, “sectors”: “2097152”, “start”: “2048”, “holders”: , “size”: “1.00 GB”}, “xvda2”: {“sectorsize”: 512, “uuid”: “dd2ac417-d452-48c9-a776-ac0e288b7ac0”, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: [“dd2ac417-d452-48c9-a776-ac0e288b7ac0”]}, “sectors”: “15599616”, “start”: “2099200”, “holders”: , “size”: “7.44 GB”}, “xvda3”: {“sectorsize”: 512, “uuid”: “2ef9af08-500a-449b-8640-e3f2a2ab5182”, “links”: {“masters”: , “labels”: , “ids”: , “uuids”: [“2ef9af08-500a-449b-8640-e3f2a2ab5182”]}, “sectors”: “424800256”, “start”: “17698816”, “holders”: , “size”: “202.56 GB”}}, “holders”: , “size”: “240.00 GB”}}, “ansible_user_uid”: 10102, “ansible_memory_mb”: {“real”: {“total”: 14915, “used”: 9391, “free”: 5524}, “swap”: {“cached”: 0, “total”: 15616, “free”: 15616, “used”: 0}, “nocache”: {“used”: 2858, “free”: 12057}}, “ansible_distribution”: “OracleLinux”, “ansible_user_dir”: “/scratch/rajrawat”, “ansible_env”: {“LANG”: “en_US.UTF-8”, “TERM”: “xterm”, “SHELL”: “/bin/bash”, “XDG_RUNTIME_DIR”: “/run/user/10102”, “SHLVL”: “2”, “SSH_TTY”: “/dev/pts/1”, “HOME”: “/scratch/rajrawat”, “SSH_CLIENT”: “10.184.157.249 22200 22”, “PWD”: “/scratch/rajrawat”, “LOGNAME”: “rajrawat”, “USER”: “rajrawat”, “MAIL”: “/var/mail/rajrawat”, “PATH”: “/usr/local/bin:/usr/bin”, “SSH_CONNECTION”: “10.184.157.249 22200 10.184.157.255 22”, “XDG_SESSION_ID”: “3486”, “_”: “/usr/bin/python”}, “ansible_distribution_major_version”: “7”, “module_setup”: true, “ansible_processor_count”: 4, “ansible_hostname”: “xyz”, “ansible_processor_vcpus”: 4, “ansible_swaptotal_mb”: 15616, “ansible_lsb”: {“release”: “7.3”, “major_release”: “7”, “codename”: “n/a”, “id”: “OracleServer”, “description”: “Oracle Linux Server release 7.3”}, “ansible_real_group_id”: 59968, “ansible_bios_date”: “05/02/2017”, “ansible_all_ipv6_addresses”: [“fe80::221:f6ff:fe46:175d”], “ansible_interfaces”: [“lo”, “docker0”, “eth0”], “ansible_uptime_seconds”: 507561, “ansible_machine_id”: “11d62f8f5dbb446c80b8623829e76ec8”, “ansible_kernel”: “4.1.12-124.19.5.el7uek.x86_64”, “ansible_iscsi_iqn”: “iqn.1988-12.com.xyz”, “ansible_system_capabilities_enforced”: “True”, “ansible_python”: {“executable”: “/usr/bin/python”, “version”: {“micro”: 5, “major”: 2, “releaselevel”: “final”, “serial”: 0, “minor”: 7}, “type”: “CPython”, “has_sslcontext”: true, “version_info”: [2, 7, 5, “final”, 0]}, “ansible_processor_threads_per_core”: 1, “ansible_fqdn”: “xyz.com”, “ansible_mounts”: [{“block_used”: 8812496, “uuid”: “2ef9af08-500a-449b-8640-e3f2a2ab5182”, “size_total”: 213949091840, “block_total”: 52233665, “mount”: “/”, “block_available”: 43421169, “size_available”: 177853108224, “fstype”: “ext4”, “inode_total”: 13279232, “options”: “rw,relatime,nobarrier,data=ordered”, “device”: “/dev/xvda3”, “inode_used”: 238512, “block_size”: 4096, “inode_available”: 13040720}, {“block_used”: 68897, “uuid”: “d6784705-7bc2-4d17-9aa9-301e6b3b05ea”, “size_total”: 25769803776, “block_total”: 6291456, “mount”: “/var/lib/docker”, “block_available”: 6222559, “size_available”: 25487601664, “fstype”: “btrfs”, “inode_total”: 0, “options”: “rw,relatime,ssd,space_cache,subvolid=257,subvol=/varlibdocker,bind”, “device”: “/dev/xvda5”, “inode_used”: 0, “block_size”: 4096, “inode_available”: 0}, {“block_used”: 271171, “uuid”: “05a976cb-f921-43c1-979e-75f6952cab7b”, “size_total”: 5148114944, “block_total”: 1256864, “mount”: “/oem”, “block_available”: 985693, “size_available”: 4037398528, “fstype”: “ext4”, “inode_total”: 327680, “options”: “rw,relatime,nobarrier,data=ordered”, “device”: “/dev/xvda6”, “inode_used”: 8978, “block_size”: 4096, “inode_available”: 318702}, {“block_used”: 58839, “uuid”: “4eb964c9-4f14-4445-b998-f98edc8d1fa7”, “size_total”: 1023303680, “block_total”: 249830, “mount”: “/boot”, “block_available”: 190991, “size_available”: 782299136, “fstype”: “ext3”, “inode_total”: 65536, “options”: “rw,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered”, “device”: “/dev/xvda1”, “inode_used”: 353, “block_size”: 4096, “inode_available”: 65183}, {“block_used”: 137490206, “uuid”: “N/A”, “size_total”: 5497499877376, “block_total”: 167770382, “mount”: “/usr/local/remote/packages”, “block_available”: 30280176, “size_available”: 992220807168, “fstype”: “nfs”, “inode_total”: 1964044895, “options”: “ro,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,acregmin=1200,acregmax=1200,acdirmin=1200,acdirmax=1200,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.184.135.151,mountvers=3,mountport=46806,mountproto=tcp,local_lock=none,addr=10.184.135.151”, “device”: “blrnas403…com:/export/local/x86_64/redhat/70_prod/packages”, “inode_used”: 26113636, “block_size”: 32768, “inode_available”: 1937931259}, {“block_used”: 68897, “uuid”: “d6784705-7bc2-4d17-9aa9-301e6b3b05ea”, “size_total”: 25769803776, “block_total”: 6291456, “mount”: “/var/lib/docker/btrfs”, “block_available”: 6222559, “size_available”: 25487601664, “fstype”: “btrfs”, “inode_total”: 0, “options”: “rw,relatime,ssd,space_cache,subvolid=257,subvol=/varlibdocker/btrfs,bind”, “device”: “/dev/xvda5”, “inode_used”: 0, “block_size”: 4096, “inode_available”: 0}], “ansible_eth0”: {“macaddress”: “00:21:f6:46:17:5d”, “features”: {“tx_checksum_ipv4”: “on [fixed]”, “generic_receive_offload”: “on”, “tx_checksum_ipv6”: “on”, “tx_scatter_gather_fraglist”: “off [fixed]”, “rx_all”: “off [fixed]”, “highdma”: “off [fixed]”, “rx_fcs”: “off [fixed]”, “tx_lockless”: “off [fixed]”, “tx_tcp_ecn_segmentation”: “off [fixed]”, “tx_tcp6_segmentation”: “on”, “tx_gso_robust”: “on [fixed]”, “tx_ipip_segmentation”: “off [fixed]”, “tx_checksumming”: “on”, “vlan_challenged”: “off [fixed]”, “hw_switch_offload”: “off [fixed]”, “loopback”: “off [fixed]”, “fcoe_mtu”: “off [fixed]”, “tx_checksum_sctp”: “off [fixed]”, “tx_vlan_stag_hw_insert”: “off [fixed]”, “rx_vlan_stag_hw_parse”: “off [fixed]”, “rx_vlan_stag_filter”: “off [fixed]”, “large_receive_offload”: “off [fixed]”, “tx_scatter_gather”: “on”, “rx_checksumming”: “on [fixed]”, “tx_tcp_segmentation”: “on”, “netns_local”: “off [fixed]”, “busy_poll”: “off [fixed]”, “generic_segmentation_offload”: “on”, “tx_udp_tnl_segmentation”: “off [fixed]”, “tcp_segmentation_offload”: “on”, “l2_fwd_offload”: “off [fixed]”, “rx_vlan_offload”: “off [fixed]”, “ntuple_filters”: “off [fixed]”, “tx_vlan_offload”: “off [fixed]”, “tx_nocache_copy”: “off”, “udp_fragmentation_offload”: “off [fixed]”, “scatter_gather”: “on”, “tx_sit_segmentation”: “off [fixed]”, “tx_checksum_fcoe_crc”: “off [fixed]”, “tx_checksum_ip_generic”: “off [fixed]”, “tx_fcoe_segmentation”: “off [fixed]”, “rx_vlan_filter”: “off [fixed]”, “receive_hashing”: “off [fixed]”, “tx_gre_segmentation”: “off [fixed]”}, “pciid”: “vif-0”, “module”: “xen_netfront”, “mtu”: 1500, “device”: “eth0”, “promisc”: false, “timestamping”: [“rx_software”, “software”], “ipv4”: {“broadcast”: “10.184.159.255”, “netmask”: “255.255.252.0”, “network”: “10.184.156.0”, “address”: “10.184.157.255”}, “ipv6”: [{“scope”: “link”, “prefix”: “64”, “address”: “fe80::221:f6ff:fe46:175d”}], “active”: true, “type”: “ether”, “hw_timestamp_filters”: }, “ansible_nodename”: “xyz.com”, “ansible_product_name”: “HVM domU”, “ansible_machine”: “x86_64”, “ansible_system_capabilities”: [“”], “ansible_all_ipv4_addresses”: [“10.184.157.255”, “172.17.0.1”], “ansible_python_version”: “2.7.5”}}\r\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\nShared connection to xyz.com closed.\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘rm -f -r /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642299.22-41934610843045/ > /dev/null 2>&1 && sleep 0’”’"‘’
<xyz.com> (0, ‘’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
ok: [xyz.com]
META: ran handlers

TASK [install apache2] **************************************************************************************************************************************
task path: /scratch/app/product/ansible/secretTest/userTest.yml:5
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘echo ~rajrawat && sleep 0’”’“‘’
<xyz.com> (0, ‘/scratch/rajrawat\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com '/bin/sh -c '”‘"’( umask 77 && mkdir -p “echo /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225” && echo ansible-tmp-1538642301.86-116046872902225=“echo /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225” ) && sleep 0’“'”‘’
<xyz.com> (0, ‘ansible-tmp-1538642301.86-116046872902225=/scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<xyz.com> PUT /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpEXhT9v TO /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/yum.py
<xyz.com> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 ‘[xyz.com]’
<xyz.com> (0, ‘sftp> put /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpEXhT9v /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/yum.py\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension “posix-rename@openssh.com” revision 1\r\ndebug2: Server supports extension “statvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “fstatvfs@openssh.com” revision 2\r\ndebug2: Server supports extension “hardlink@openssh.com” revision 1\r\ndebug2: Server supports extension “fsync@openssh.com” revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . → /scratch/rajrawat size 0\r\ndebug3: Looking up /scratch/rajrawat/.ansible/tmp/ansible-local-16934Tin3j/tmpEXhT9v\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn't stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/yum.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:3625\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 3625 bytes at 98304\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘chmod u+x /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/ /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/yum.py && sleep 0’”’“‘’
<xyz.com> (0, ‘’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 -tt xyz.com '/bin/sh -c '”‘“‘sudo -H -S -p “[sudo via ansible, key=tntxgmfcxumuvsdzcfoamuanirxthzxa] password: " -u root /bin/sh -c '”’”’“'”‘"’“'”‘“‘echo BECOME-SUCCESS-tntxgmfcxumuvsdzcfoamuanirxthzxa; /usr/bin/python /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/yum.py’”’“'”‘"’“'”‘"’“’ && sleep 0’”‘"’’
<xyz.com> (1, ‘rajrawat is not allowed to run sudo on xyz. This incident will be reported.\r\n’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 xyz.com closed.\r\n’)
<xyz.com> ESTABLISH SSH CONNECTION FOR USER: rajrawat
<xyz.com> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=rajrawat -o ConnectTimeout=10 -o ControlPath=/scratch/rajrawat/.ansible/cp/3af502ab58 xyz.com ‘/bin/sh -c ‘"’“‘rm -f -r /scratch/rajrawat/.ansible/tmp/ansible-tmp-1538642301.86-116046872902225/ > /dev/null 2>&1 && sleep 0’”’"‘’
<xyz.com> (0, ‘’, ‘OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 0\r\n’)
fatal: [xyz.com]: FAILED! => {
“changed”: false,
“module_stderr”: “OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /scratch/rajrawat/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 54: 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_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 = 1730\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 xyz.com closed.\r\n”,
“module_stdout”: “rajrawat is not allowed to run sudo on xyz. This incident will be reported.\r\n”,
“msg”: “MODULE FAILURE”,
“rc”: 1
}
to retry, use: --limit @/scratch/app/product/ansible/secretTest/userTest.retry

PLAY RECAP **************************************************************************************************************************************************
xyz.com : ok=1 changed=0 unreachable=0 failed=1

Bassed on the output i still thing something is missing with the sudoers configuration, you need to check logs and configuration.

This will print the groups your user is a member off
   ansible xyz.com -a id

You should also check the auth/secure log in /var/log/ (I think the file is called secure in RHEL realm) it should have some information about why user is denied sudo access.

Hi Kai,

Output: ansible xyz.com -a id

xyz.com | SUCCESS | rc=0 >>
uid=10102(rajrawat) gid=59968(oinstall) groups=59968(oinstall),10(wheel)

/etc/log/secure file contents:

Oct 4 23:09:18 xyz sshd[12957]: pam_unix(sshd:session): session opened for user rajrawat by (uid=0)
Oct 4 23:09:22 xyz sudo: PAM unable to dlopen(/usr/lib/security/pam_pwquality.so): /usr/lib/security/pam_pwquality.so: cannot open shared object file: No such file or directory
Oct 4 23:09:22 xyz sudo: PAM adding faulty module: /usr/lib/security/pam_pwquality.so

Kindly suggest on what could be the problem.

It looks like one of you pam files (most likely system-auth-ac or password-auth-ac) have pam_pwquality.so in it and that does not seem to be loaded on the server. Check that out.

Output: ansible xyz.com -a id
xyz.com | SUCCESS | rc=0 >>
uid=10102(rajrawat) gid=59968(oinstall) groups=59968(oinstall),10(wheel)

This also show that you are member of wheel, and that Ansible is running under those membership.

/etc/log/secure file contents:

Oct 4 23:09:18 xyz sshd[12957]: pam_unix(sshd:session): session opened for user rajrawat by (uid=0)
Oct 4 23:09:22 xyz sudo: PAM unable to dlopen(/usr/lib/security/pam_pwquality.so): /usr/lib/security/pam_pwquality.so: cannot open shared object file: No such file or directory
Oct 4 23:09:22 xyz sudo: PAM adding faulty module: /usr/lib/security/pam_pwquality.so

This indicate to me that you are not running the vanilla distribution but some customization has been done.
Might it be that some of this customization has broken some part of PAM and/or sudoers?

When you log in and run sudo you are using an interactive shell, but when Ansible is running it is using non-interactive shell this might be and factor if any customization has been done to the server.

Kindly suggest on what could be the problem.

Apart from the above I don't have any more to contribute since that would be outside of this groups scope.

Thanks Kai for the valuable information you shared with me.