{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/30403","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/30403/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/30403/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/30403/events","html_url":"https://github.com/ansible/ansible/issues/30403","id":257939453,"number":30403,"title":"net_l3_interface KeyError: 'ansible_facts'","user":{"login":"davedastrange","id":4404536,"avatar_url":"https://avatars0.githubusercontent.com/u/4404536?v=4","gravatar_id":"","url":"https://api.github.com/users/davedastrange","html_url":"https://github.com/davedastrange","followers_url":"https://api.github.com/users/davedastrange/followers","following_url":"https://api.github.com/users/davedastrange/following{/other_user}","gists_url":"https://api.github.com/users/davedastrange/gists{/gist_id}","starred_url":"https://api.github.com/users/davedastrange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davedastrange/subscriptions","organizations_url":"https://api.github.com/users/davedastrange/orgs","repos_url":"https://api.github.com/users/davedastrange/repos","events_url":"https://api.github.com/users/davedastrange/events{/privacy}","received_events_url":"https://api.github.com/users/davedastrange/received_events","type":"User","site_admin":false},"labels":[{"id":562292166,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.4","name":"affects_2.4","color":"ededed","default":false},{"id":686214011,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.5","name":"affects_2.5","color":"ededed","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":339653091,"url":"https://api.github.com/repos/ansible/ansible/labels/networking","name":"networking","color":"c7def8","default":false},{"id":669761792,"url":"https://api.github.com/repos/ansible/ansible/labels/support:network","name":"support:network","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"Qalthos","id":649648,"avatar_url":"https://avatars2.githubusercontent.com/u/649648?v=4","gravatar_id":"","url":"https://api.github.com/users/Qalthos","html_url":"https://github.com/Qalthos","followers_url":"https://api.github.com/users/Qalthos/followers","following_url":"https://api.github.com/users/Qalthos/following{/other_user}","gists_url":"https://api.github.com/users/Qalthos/gists{/gist_id}","starred_url":"https://api.github.com/users/Qalthos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qalthos/subscriptions","organizations_url":"https://api.github.com/users/Qalthos/orgs","repos_url":"https://api.github.com/users/Qalthos/repos","events_url":"https://api.github.com/users/Qalthos/events{/privacy}","received_events_url":"https://api.github.com/users/Qalthos/received_events","type":"User","site_admin":false},"assignees":[{"login":"Qalthos","id":649648,"avatar_url":"https://avatars2.githubusercontent.com/u/649648?v=4","gravatar_id":"","url":"https://api.github.com/users/Qalthos","html_url":"https://github.com/Qalthos","followers_url":"https://api.github.com/users/Qalthos/followers","following_url":"https://api.github.com/users/Qalthos/following{/other_user}","gists_url":"https://api.github.com/users/Qalthos/gists{/gist_id}","starred_url":"https://api.github.com/users/Qalthos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qalthos/subscriptions","organizations_url":"https://api.github.com/users/Qalthos/orgs","repos_url":"https://api.github.com/users/Qalthos/repos","events_url":"https://api.github.com/users/Qalthos/events{/privacy}","received_events_url":"https://api.github.com/users/Qalthos/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ansible/ansible/milestones/10","html_url":"https://github.com/ansible/ansible/milestone/10","labels_url":"https://api.github.com/repos/ansible/ansible/milestones/10/labels","id":2338346,"number":10,"title":"2.4.0","description":"Dancing Days","creator":{"login":"thaumos","id":891871,"avatar_url":"https://avatars1.githubusercontent.com/u/891871?v=4","gravatar_id":"","url":"https://api.github.com/users/thaumos","html_url":"https://github.com/thaumos","followers_url":"https://api.github.com/users/thaumos/followers","following_url":"https://api.github.com/users/thaumos/following{/other_user}","gists_url":"https://api.github.com/users/thaumos/gists{/gist_id}","starred_url":"https://api.github.com/users/thaumos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaumos/subscriptions","organizations_url":"https://api.github.com/users/thaumos/orgs","repos_url":"https://api.github.com/users/thaumos/repos","events_url":"https://api.github.com/users/thaumos/events{/privacy}","received_events_url":"https://api.github.com/users/thaumos/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":319,"state":"open","created_at":"2017-02-21T17:24:56Z","updated_at":"2017-09-15T15:29:25Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-09-15T06:27:53Z","updated_at":"2017-09-15T16:28:54Z","closed_at":null,"author_association":"NONE","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nAlso test if the latest release, and master branch are affected too.\r\n-->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/task/feature -->\r\nnet_l3_interface\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.5.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/dseelbach/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible\r\n  executable location = /usr/local/bin/ansible\r\n  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.\r\n-->\r\nN/A\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\n```\r\nThe full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py\", line 125, in run\r\n    res = self._execute()\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py\", line 528, in _execute\r\n    result = self._handler.run(task_vars=variables)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_l3_interface.py\", line 25, in run\r\n    result = super(ActionModule, self).run(tmp, task_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_base.py\", line 47, in run\r\n    play_context.network_os = self._get_network_os(task_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_base.py\", line 147, in _get_network_os\r\n    elif ('network_os' in task_vars['ansible_facts'] and\r\nKeyError: 'ansible_facts'\r\n\r\nfatal: [os-node4]: FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"Unexpected failure during module execution.\", \r\n    \"stdout\": \"\"\r\n}\r\n```\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used.\r\n-->\r\ninstall ansible 2.5.0.0\r\ntask with net_l3_interface\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- name: set eth1 on os-node4\r\n  connection: local\r\n  gather_facts: False\r\n  net_l3_interface:\r\n    name: eth1\r\n    ipv4: 192.168.10.14/24\r\n    ipv6: '2a01:dead:beef:372::134/64'\r\n    state: present\r\n  when: ansible_hostname == \"os-node4\"\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\ninterfaces getting ipv4 and ipv6 adresses\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nThe full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py\", line 125, in run\r\n    res = self._execute()\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py\", line 528, in _execute\r\n    result = self._handler.run(task_vars=variables)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_l3_interface.py\", line 25, in run\r\n    result = super(ActionModule, self).run(tmp, task_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_base.py\", line 47, in run\r\n    play_context.network_os = self._get_network_os(task_vars)\r\n  File \"/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/net_base.py\", line 147, in _get_network_os\r\n    elif ('network_os' in task_vars['ansible_facts'] and\r\nKeyError: 'ansible_facts'\r\n\r\nfatal: [os-node4]: FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"Unexpected failure during module execution.\", \r\n    \"stdout\": \"\"\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/329832223","html_url":"https://github.com/ansible/ansible/issues/30403#issuecomment-329832223","issue_url":"https://api.github.com/repos/ansible/ansible/issues/30403","id":329832223,"user":{"login":"Qalthos","id":649648,"avatar_url":"https://avatars2.githubusercontent.com/u/649648?v=4","gravatar_id":"","url":"https://api.github.com/users/Qalthos","html_url":"https://github.com/Qalthos","followers_url":"https://api.github.com/users/Qalthos/followers","following_url":"https://api.github.com/users/Qalthos/following{/other_user}","gists_url":"https://api.github.com/users/Qalthos/gists{/gist_id}","starred_url":"https://api.github.com/users/Qalthos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Qalthos/subscriptions","organizations_url":"https://api.github.com/users/Qalthos/orgs","repos_url":"https://api.github.com/users/Qalthos/repos","events_url":"https://api.github.com/users/Qalthos/events{/privacy}","received_events_url":"https://api.github.com/users/Qalthos/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T16:28:54Z","updated_at":"2017-09-15T16:28:54Z","author_association":"CONTRIBUTOR","body":"The quick answer is that you need to assign the var `ansible_netowork_os: [eos|ios|iosxr|etc]` to your hosts in order to use the platform agnostic modules. This is unfortunately neither documented anywhere nor reported in the error. A fix to clarify the error message should be in soon (though maybe not soon enough for 2.4.0)."}}
{"actor":{"display_login":"Qalthos"}}