{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11808","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11808/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11808/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11808/events","html_url":"https://github.com/ansible/ansible/issues/11808","id":98263019,"number":11808,"title":"FAILED! => {\"failed\": true, \"msg\": \"ERROR! Connection closed waiting for privilege escalation password prompt: /home/ansible/.ansible/tmp/ansible-tmp-1438288298.05-93146604594652\\r\\n \"}","user":{"login":"basictheprogram","id":6723257,"avatar_url":"https://avatars.githubusercontent.com/u/6723257?v=3","gravatar_id":"","url":"https://api.github.com/users/basictheprogram","html_url":"https://github.com/basictheprogram","followers_url":"https://api.github.com/users/basictheprogram/followers","following_url":"https://api.github.com/users/basictheprogram/following{/other_user}","gists_url":"https://api.github.com/users/basictheprogram/gists{/gist_id}","starred_url":"https://api.github.com/users/basictheprogram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basictheprogram/subscriptions","organizations_url":"https://api.github.com/users/basictheprogram/orgs","repos_url":"https://api.github.com/users/basictheprogram/repos","events_url":"https://api.github.com/users/basictheprogram/events{/privacy}","received_events_url":"https://api.github.com/users/basictheprogram/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/5","html_url":"https://github.com/ansible/ansible/milestones/v2","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/5/labels","id":975800,"number":5,"title":"v2","description":null,"creator":{"login":"bcoca","id":836171,"avatar_url":"https://avatars.githubusercontent.com/u/836171?v=3","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":170,"state":"open","created_at":"2015-02-11T19:43:06Z","updated_at":"2015-08-05T21:30:11Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-07-30T20:56:32Z","updated_at":"2015-08-06T07:46:18Z","closed_at":"2015-08-03T22:49:00Z","body":"##### Issue Type:\r\nBug Report\r\n\r\n##### Ansible Version:\r\n$ ansible --version\r\nansible 2.0.0 (devel 222f04e387) last updated 2015/07/30 14:22:39 (GMT -500)\r\n  lib/ansible/modules/core: (detached HEAD 79f21c6ec9) last updated 2015/07/30 14:22:39 (GMT -500)\r\n  lib/ansible/modules/extras: (detached HEAD 50f4b2c3de) last updated 2015/07/30 14:22:39 (GMT -500)\r\n  v1/ansible/modules/core: (detached HEAD f8d8af17cd) last updated 2015/06/03 00:37:54 (GMT -500)\r\n  v1/ansible/modules/extras: (detached HEAD 495ad450e5) last updated 2015/06/03 00:37:58 (GMT -500)\r\n  config file = /Volumes/Warrior1TB/Users/tanner/projects/ansible.git/playbooks/ansible.cfg\r\n  configured module search path = None\r\n\r\n##### Ansible Configuration:\r\n$ source hacking/env-setup\r\n\r\nmy ansible.cfg  as follows:\r\n```\r\n#sudo_user      = root\r\n#ask_sudo_pass = True\r\n#ask_pass      = True\r\n\r\n[privilege_escalation]\r\nbecome=True\r\nbecome_method=sudo\r\nbecome_user=root\r\nbecome_ask_pass=True\r\n```\r\n##### Environment:\r\nOS X Yosemite 10.10.4\r\n\r\n$ python -V\r\nPython 2.7.6\r\n\r\n##### Summary:\r\nMight be related to #11796?\r\n\r\nMigrating to --become and plays that worked with --ask-sudo-pass now fail with \r\n```\r\nFAILED! => {\"failed\": true, \"msg\": \"ERROR! Connection closed waiting for privilege escalation password prompt: /home/ansible/.ansible/tmp/ansible-tmp-1438288298.05-93146604594652\\r\\n \"}\r\n```\r\n\r\n##### Steps To Reproduce:\r\n```\r\n$ source hacking/env-setup\r\n$ cd ../playbooks/\r\n$ ansible-playbook -i vagrant_ansible_inventory vagrant.yml -vvvv\r\nUsing /very/long/path/to/ansible.cfg as config file\r\nSUDO password:\r\n1 plays in /very/long/path/vagrant.yml\r\nLoaded callback default of type stdout, v2.0\r\n\r\nPLAY ****************************************************************************\r\nTASK [setup] ********************************************************************\r\n<snip>\r\nTASK [network_interface : Create the network configuration file for ethernet devices] ***\r\n<10.x.x.x> ESTABLISH SSH CONNECTION FOR USER: ansible\r\n<10.x.x.x> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=600s -o ControlPath=\"/tmp/ansible-ssh-%h-%p-%r\" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 10.x.x.x mkdir -p \"$HOME/.ansible/tmp/ansible-tmp-1438288912.01-74322629008904\" && chmod a+rx \"$HOME/.ansible/tmp/ansible-tmp-1438288912.01-74322629008904\" && echo \"$HOME/.ansible/tmp/ansible-tmp-1438288912.01-74322629008904\"\r\n<10.x.x.x> ESTABLISH SSH CONNECTION FOR USER: ansible\r\n<10.x.x.x> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=600s -o ControlPath=\"/tmp/ansible-ssh-%h-%p-%r\" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 10.x.x.x /bin/sh -c 'sudo -k && sudo -H -S -p \"[sudo via ansible, key=mofwukoyfvezuwznlxknthbjmxocqooc] password: \" -u root /bin/sh -c '\"'\"'echo BECOME-SUCCESS-mofwukoyfvezuwznlxknthbjmxocqooc; rc=flag; [ -r /etc/network/interfaces.d/eth0.cfg ] || rc=2; [ -f /etc/network/interfaces.d/eth0.cfg ] || rc=1; [ -d /etc/network/interfaces.d/eth0.cfg ] && rc=3; python -V 2>/dev/null || rc=4; [ x\"$rc\" != \"xflag\" ] && echo \"${rc}  \"/etc/network/interfaces.d/eth0.cfg && exit 0; (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/etc/network/interfaces.d/eth0.cfg'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n\thasher.update(buf)\r\n\tbuf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import sha; BLOCKSIZE = 65536; hasher = sha.sha();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/etc/network/interfaces.d/eth0.cfg'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n\thasher.update(buf)\r\n\tbuf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (echo '\"'\"'\"'\"'\"'\"'\"'\"'0  '\"'\"'\"'\"'\"'\"'\"'\"'/etc/network/interfaces.d/eth0.cfg)'\"'\"''\r\n<very long wait>\r\nFAILED! => {\"failed\": true, \"msg\": \"ERROR! Connection closed waiting for privilege escalation password prompt: /home/ansible/.ansible/tmp/ansible-tmp-1438288298.05-93146604594652\\r\\n \"}\r\n```\r\n\r\nHere is the play that is throwing the error, I got the role using  ansible-galaxy but this is git repo for the role: [bennojoy.network_interface](https://github.com/bennojoy/network_interface)\r\n```\r\n- name: Create the network configuration file for ethernet devices\r\n  template: src=ethernet_{{ ansible_os_family }}.j2 dest={{ net_path }}/{{ item.device }}.cfg\r\n  with_items: network_ether_interfaces\r\n  when: network_ether_interfaces is defined\r\n  register: ether_result\r\n```\r\n\r\nThe relevant vagrant.yml \r\n```\r\n--\r\n# file: vagrant.yml\r\n\r\n- hosts: testing\r\n  remote_user: ansible\r\nvars:\r\n    network_ether_interfaces:\r\n        - device: eth0\r\n          bootproto: static\r\n          address: 10.x.x.192\r\n          netmask: 255.255.255.0\r\n          gateway: 10.x.x.254\r\nroles:\r\n    - { role: network_interface, sudo: yes }\r\n```\r\n##### Expected Results:\r\nI assume the plays would run to completion like it does when I using '-k -K' on the command line\r\n\r\n##### Actual Results:\r\nFAILED! => {\"failed\": true, \"msg\": \"ERROR! Connection closed waiting for privilege escalation password prompt: /home/ansible/.ansible/tmp/ansible-tmp-1438288298.05-93146604594652\\r\\n \"}"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/128280479","html_url":"https://github.com/ansible/ansible/issues/11808#issuecomment-128280479","issue_url":"https://api.github.com/repos/ansible/ansible/issues/11808","id":128280479,"user":{"login":"basictheprogram","id":6723257,"avatar_url":"https://avatars.githubusercontent.com/u/6723257?v=3","gravatar_id":"","url":"https://api.github.com/users/basictheprogram","html_url":"https://github.com/basictheprogram","followers_url":"https://api.github.com/users/basictheprogram/followers","following_url":"https://api.github.com/users/basictheprogram/following{/other_user}","gists_url":"https://api.github.com/users/basictheprogram/gists{/gist_id}","starred_url":"https://api.github.com/users/basictheprogram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basictheprogram/subscriptions","organizations_url":"https://api.github.com/users/basictheprogram/orgs","repos_url":"https://api.github.com/users/basictheprogram/repos","events_url":"https://api.github.com/users/basictheprogram/events{/privacy}","received_events_url":"https://api.github.com/users/basictheprogram/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T07:46:18Z","updated_at":"2015-08-06T07:46:18Z","body":"From your control host what is the result if you cut-n-paste the ssh command into the shell by hand?\r\n```\r\nssh -C -tt -q -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=\"/tmp/ansible-ssh-%h-%p-%r\" -o Port=993 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 bob.boboslair /bin/sh -c 'sudo -k && sudo -H -S -p \"[sudo via ansible, key=gqekzduuyjfddxewzkwpathzobfcqck] password: \" -u root /bin/sh -c '\"'\"'echo BECOME-SUCCESS-gqekzduuyjfddxewzkwpathzobfcqck; rc=flag; [ -r /root/provisioning_doc.txt ] || rc=2; [ -f /root/provisioning_doc.txt ] || rc=1; [ -d /root/provisioning_doc.txt ] && rc=3; python -V 2>/dev/null || rc=4; [ x\"$rc\" != \"xflag\" ] && echo \"${rc}  \"/root/provisioning_doc.txt && exit 0; (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/root/provisioning_doc.txt'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n        hasher.update(buf)\r\n        buf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (python -c '\"'\"'\"'\"'\"'\"'\"'\"'import sha; BLOCKSIZE = 65536; hasher = sha.sha();\r\nafile = open(\"'\"'\"'\"'\"'\"'\"'\"'\"'/root/provisioning_doc.txt'\"'\"'\"'\"'\"'\"'\"'\"'\", \"rb\")\r\nbuf = afile.read(BLOCKSIZE)\r\nwhile len(buf) > 0:\r\n        hasher.update(buf)\r\n        buf = afile.read(BLOCKSIZE)\r\nafile.close()\r\nprint(hasher.hexdigest())'\"'\"'\"'\"'\"'\"'\"'\"' 2>/dev/null) || (echo '\"'\"'\"'\"'\"'\"'\"'\"'0  '\"'\"'\"'\"'\"'\"'\"'\"'/root/provisioning_doc.txt)'\"'\"''\r\n```\r\nIs it throwing a sudo invocation error?"}}