{"action":"created","issue":{"url":"https://api.github.com/repos/quipucords/rho/issues/477","repository_url":"https://api.github.com/repos/quipucords/rho","labels_url":"https://api.github.com/repos/quipucords/rho/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/quipucords/rho/issues/477/comments","events_url":"https://api.github.com/repos/quipucords/rho/issues/477/events","html_url":"https://github.com/quipucords/rho/issues/477","id":274651040,"number":477,"title":"Ansible bug causes scan to hang if host is lost","user":{"login":"kdelee","id":29239279,"avatar_url":"https://avatars1.githubusercontent.com/u/29239279?v=4","gravatar_id":"","url":"https://api.github.com/users/kdelee","html_url":"https://github.com/kdelee","followers_url":"https://api.github.com/users/kdelee/followers","following_url":"https://api.github.com/users/kdelee/following{/other_user}","gists_url":"https://api.github.com/users/kdelee/gists{/gist_id}","starred_url":"https://api.github.com/users/kdelee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdelee/subscriptions","organizations_url":"https://api.github.com/users/kdelee/orgs","repos_url":"https://api.github.com/users/kdelee/repos","events_url":"https://api.github.com/users/kdelee/events{/privacy}","received_events_url":"https://api.github.com/users/kdelee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-16T20:21:33Z","updated_at":"2017-11-29T17:01:05Z","closed_at":null,"author_association":"NONE","body":"There appears to be a bug in ansible that will cause a scan to hang if a host is lost.\r\n\r\nA bug needs to be filed in Anisble once we have reproducer using just ansible."},"comment":{"url":"https://api.github.com/repos/quipucords/rho/issues/comments/347926433","html_url":"https://github.com/quipucords/rho/issues/477#issuecomment-347926433","issue_url":"https://api.github.com/repos/quipucords/rho/issues/477","id":347926433,"user":{"login":"kdelee","id":29239279,"avatar_url":"https://avatars1.githubusercontent.com/u/29239279?v=4","gravatar_id":"","url":"https://api.github.com/users/kdelee","html_url":"https://github.com/kdelee","followers_url":"https://api.github.com/users/kdelee/followers","following_url":"https://api.github.com/users/kdelee/following{/other_user}","gists_url":"https://api.github.com/users/kdelee/gists{/gist_id}","starred_url":"https://api.github.com/users/kdelee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdelee/subscriptions","organizations_url":"https://api.github.com/users/kdelee/orgs","repos_url":"https://api.github.com/users/kdelee/repos","events_url":"https://api.github.com/users/kdelee/events{/privacy}","received_events_url":"https://api.github.com/users/kdelee/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T17:01:05Z","updated_at":"2017-11-29T17:01:05Z","author_association":"NONE","body":"It looks like either of these are possible work arounds, but the config file is least invasive and directly addresses the issue at hand, which is the case that we want to be able to continue even if we lose one host.\r\n\r\nThe async/poll more addresses when one host of several is stuck indefinitely actually doing something on a host (i.e. it is still alive).\r\n\r\nWith the follwoing `ansible.cfg` in the directory of execution:\r\n```ini\r\n#ansible.cfg\r\n[ssh_connection]\r\n\r\nssh_args = -o ServerAliveInterval=10\r\n```\r\nAnd executing the following playbook:\r\n\r\n```yml\r\n---\r\n\r\n- name: reproduce lost host task hang\r\n  hosts: all\r\n  strategy: free\r\n  tasks:\r\n    - name: Do something that takes time 1\r\n      shell: \"ping -c 30 localhost\"\r\n# after the first task completes, I kill one of the machines\r\n    - name: Do something that takes time 2\r\n      shell: \"for i in {1..10}; do echo $i && sleep 2; done;\"\r\n    - name: Do something that takes time 1\r\n      shell: \"ping -c 30 localhost\"\r\n    - name: Do something that takes time 3\r\n      shell: \"for i in {1..10}; do echo $i && sleep 2; done;\"\r\n\r\n```\r\n\r\nI get the following output when I kill a server when the 2nd long running task is happening (after the 1st one completes).\r\n\r\n```bash\r\nansible-playbook -i hosts kill-host.yml \r\n\r\nPLAY [reproduce lost host task hang] *******************************************************************\r\n\r\nTASK [Gathering Facts] *********************************************************************************\r\nok: [10.10.XXX.XXX]\r\nok: [localhost]\r\n\r\nTASK [Do something that takes time 1] ******************************************************************\r\nchanged: [10.10.XXX.XXX]\r\nchanged: [localhost]\r\n\r\nTASK [Do something that takes time 2] ******************************************************************\r\nchanged: [localhost]\r\nfatal: [10.10.XXX.XXX]: UNREACHABLE! => {\"changed\": false, \"msg\": \"Failed to connect to the host via ssh: Timeout, server 10.10.XXX.XXX not responding.\\r\\n\", \"unreachable\": true}\r\n\r\nTASK [Do something that takes time 1] ******************************************************************\r\nchanged: [localhost]\r\n\r\nTASK [Do something that takes time 3] ******************************************************************\r\nchanged: [localhost]\r\n\tto retry, use: --limit @/home/elijah/test/kill-host.retry\r\n\r\nPLAY RECAP *********************************************************************************************\r\n10.10.XXX.XXX              : ok=2    changed=1    unreachable=1    failed=0   \r\nlocalhost                  : ok=5    changed=4    unreachable=0    failed=0   \r\n\r\n```\r\n\r\nNow the question is -- how do we ship this? Do we just tell users to put this in their global config file? Do we edit the file for them in the install process?"}}
{"actor":{"display_login":"kdelee"}}