{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-runner/issues/27","repository_url":"https://api.github.com/repos/ansible/ansible-runner","labels_url":"https://api.github.com/repos/ansible/ansible-runner/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-runner/issues/27/comments","events_url":"https://api.github.com/repos/ansible/ansible-runner/issues/27/events","html_url":"https://github.com/ansible/ansible-runner/issues/27","id":317660301,"number":27,"title":"KeyError: 'PATH' on ansible-playbook execution","user":{"login":"radez","id":361619,"avatar_url":"https://avatars2.githubusercontent.com/u/361619?v=4","gravatar_id":"","url":"https://api.github.com/users/radez","html_url":"https://github.com/radez","followers_url":"https://api.github.com/users/radez/followers","following_url":"https://api.github.com/users/radez/following{/other_user}","gists_url":"https://api.github.com/users/radez/gists{/gist_id}","starred_url":"https://api.github.com/users/radez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radez/subscriptions","organizations_url":"https://api.github.com/users/radez/orgs","repos_url":"https://api.github.com/users/radez/repos","events_url":"https://api.github.com/users/radez/events{/privacy}","received_events_url":"https://api.github.com/users/radez/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-25T14:43:53Z","updated_at":"2018-04-30T13:16:48Z","closed_at":"2018-04-30T13:16:48Z","author_association":"COLLABORATOR","body":"[root@opnfv ansible-runner]# ansible-playbook -i 192.168.121.114, -u ansible -k -e ansible_network_os=junos dan-test.yaml \r\nSSH password: \r\n\r\nPLAY [Network Getting Started First Playbook] *********************************************************************************************************************************************************************\r\n\r\nTASK [Gathering Facts] ********************************************************************************************************************************************************************************************\r\nok: [192.168.121.114]\r\n\r\nTASK [Get config for junos switch] ********************************************************************************************************************************************************************************\r\nok: [192.168.121.114]\r\n\r\nPLAY RECAP ********************************************************************************************************************************************************************************************************\r\n192.168.121.114            : ok=2    changed=0    unreachable=0    failed=0   \r\n\r\n\r\n[root@opnfv ansible-runner]# python dan-test.py \r\nNot loading passwords\r\nNot loading environment vars\r\nNot loading extra vars\r\nNot loading settings\r\nNot loading ssh key\r\nParsed /tmp/tmpNsTCJY/inventory/hosts.json inventory source with yaml plugin\r\n\r\nPLAYBOOK: main.json ************************************************************\r\n1 plays in /tmp/tmpNsTCJY/project/main.json\r\n\r\nPLAY [Openstack networking-ansible test] ***************************************\r\n\r\nTASK [Gathering Facts] *********************************************************\r\nThe full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py\", line 138, in run\r\n    res = self._execute()\r\n  File \"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py\", line 516, in _execute\r\n    self._connection = self._get_connection(variables=variables, templar=templar)\r\n  File \"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py\", line 790, in _get_connection\r\n    socket_path = self._start_connection()\r\n  File \"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py\", line 877, in _start_connection\r\n    [python, find_file_in_path('ansible-connection'), to_text(os.getppid())],\r\n  File \"/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py\", line 868, in find_file_in_path\r\n    paths = os.environ['PATH'].split(os.pathsep) + [os.path.dirname(sys.argv[0])]\r\n  File \"/usr/lib64/python2.7/UserDict.py\", line 23, in __getitem__\r\n    raise KeyError(key)\r\nKeyError: 'PATH'\r\nfatal: [192.168.121.114]: FAILED! => {\r\n    \"msg\": \"Unexpected failure during module execution.\", \r\n    \"stdout\": \"\"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\n192.168.121.114            : ok=0    changed=0    unreachable=0    failed=1   \r\n\r\n\r\n[root@opnfv ansible-runner]# cat dan-test.yaml \r\n- name: Network Getting Started First Playbook\r\n  connection: netconf\r\n  hosts: all\r\n  tasks:\r\n\r\n    - name: Get config for junos switch\r\n      junos_facts:\r\n[root@opnfv ansible-runner]# cat dan-test.py \r\nimport ansible_runner as ar\r\n\r\npb = [{\r\n    'name': 'Openstack networking-ansible test',\r\n    'connection': 'netconf',\r\n    'hosts': '192.168.121.114',\r\n    'tasks': [\r\n        {'name': 'Gather Facts',\r\n         'junos_facts': None,}\r\n    ]\r\n}]\r\n\r\ninventory = {'all':\r\n                {'hosts': \r\n                    {'192.168.121.114': \r\n                        {'ansible_user': 'ansible',\r\n                         'ansible_ssh_pass': 'password'}\r\n                    }\r\n                }\r\n            }\r\n\r\nar.run(playbook=pb, inventory=inventory)"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-runner/issues/comments/385394985","html_url":"https://github.com/ansible/ansible-runner/issues/27#issuecomment-385394985","issue_url":"https://api.github.com/repos/ansible/ansible-runner/issues/27","id":385394985,"user":{"login":"matburt","id":89544,"avatar_url":"https://avatars0.githubusercontent.com/u/89544?v=4","gravatar_id":"","url":"https://api.github.com/users/matburt","html_url":"https://github.com/matburt","followers_url":"https://api.github.com/users/matburt/followers","following_url":"https://api.github.com/users/matburt/following{/other_user}","gists_url":"https://api.github.com/users/matburt/gists{/gist_id}","starred_url":"https://api.github.com/users/matburt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matburt/subscriptions","organizations_url":"https://api.github.com/users/matburt/orgs","repos_url":"https://api.github.com/users/matburt/repos","events_url":"https://api.github.com/users/matburt/events{/privacy}","received_events_url":"https://api.github.com/users/matburt/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T13:16:48Z","updated_at":"2018-04-30T13:16:48Z","author_association":"MEMBER","body":"fixed in #28 "}}
{"actor":{"display_login":"matburt"}}