{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5557","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5557/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5557/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5557/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/5557","id":188582607,"number":5557,"title":"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py","user":{"login":"AlainG80","id":23386162,"avatar_url":"https://avatars.githubusercontent.com/u/23386162?v=3","gravatar_id":"","url":"https://api.github.com/users/AlainG80","html_url":"https://github.com/AlainG80","followers_url":"https://api.github.com/users/AlainG80/followers","following_url":"https://api.github.com/users/AlainG80/following{/other_user}","gists_url":"https://api.github.com/users/AlainG80/gists{/gist_id}","starred_url":"https://api.github.com/users/AlainG80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlainG80/subscriptions","organizations_url":"https://api.github.com/users/AlainG80/orgs","repos_url":"https://api.github.com/users/AlainG80/repos","events_url":"https://api.github.com/users/AlainG80/events{/privacy}","received_events_url":"https://api.github.com/users/AlainG80/received_events","type":"User","site_admin":false},"labels":[{"id":437720272,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/affects_2.0","name":"affects_2.0","color":"5319e7","default":false},{"id":132571937,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":132897312,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/needs_info","name":"needs_info","color":"eb6420","default":false},{"id":275173408,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/networking","name":"networking","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-10T18:25:42Z","updated_at":"2016-11-11T09:14:04Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n\r\n##### COMPONENT NAME\r\nvyos_facts \r\nvyos_command \r\nvyos_config\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.0.2.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = /usr/lib/python2.7/dist-packages/ansible/modules/core/\r\n\r\n```\r\n\r\n##### CONFIGURATION\r\n```\r\n$ dpkg -l ansible\r\nDesired=Unknown/Install/Remove/Purge/Hold\r\n| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend\r\n|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)\r\n||/ Name                                     Version                   Architecture              Description\r\n+++-========================================-=========================-=========================-=====================================================================================\r\nii  ansible                                  2.2.0.0-1ppa~xenial       all                       A radically simple IT automation platform\r\nsudo dpkg -V ansible\r\n??5?????? c /etc/ansible/hosts\r\nAdded 3 vyos hosts.\r\n??5?????? c /etc/ansible/ansible.cfg\r\nChanged library path:\r\nlibrary        = /usr/lib/python2.7/dist-packages/ansible/modules/core/\r\nChanged pythonpath:\r\necho $PYTHONPATH\r\n/usr/local/lib/python2.7/dist-packages:/usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/dist-packages\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n```\r\nLinux ansible 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\r\nUbuntu 16.04.1 LTS\r\n```\r\n\r\n##### SUMMARY\r\nWhen using the ad-hoc command to troubleshoot the playbook modules, I get the following error:\r\n```\r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n```\r\n\r\n##### STEPS TO REPRODUCE\r\n```\r\n$ ANSIBLE_KEEP_REMOTE_FILES=1 ansible -vvvvv all -m vyos_facts\r\nUsing /etc/ansible/ansible.cfg as config file\r\nLoaded callback minimal of type stdout, v2.0\r\n10.10.10.167 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.10.10.168 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.10.10.169 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n```\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n$ ansible-playbook -vvvvv vyos.yml \r\nUsing /etc/ansible/ansible.cfg as config file\r\nERROR! this task 'vyos_facts' has extra params, which is only allowed in the following modules: command, shell, script, include, include_vars, add_host, group_by, set_fact, raw, meta\r\n\r\nThe error appears to have been in '/home/sveer/vyos.yml': line 14, column 7, but may\r\nbe elsewhere in the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n\r\n    - name: collect only the config and default facts\r\n      ^ here\r\n\r\n\r\nThe error appears to have been in '/home/sveer/vyos.yml': line 14, column 7, but may\r\nbe elsewhere in the file depending on the exact syntax problem.\r\n\r\nThe offending line appears to be:\r\n\r\n\r\n    - name: collect only the config and default facts\r\n      ^ here\r\n---\r\n# Note: examples below use the following provider dict to handle\r\n#       transport and authentication to the node\r\n- hosts: all\r\n  user: vyatta\r\n  vars:\r\n    transport: cli\r\n\r\n  tasks:\r\n    - name: collect all facts from the device\r\n      vyos_facts:\r\n        gather_subset: all\r\n\r\n    - name: collect only the config and default facts\r\n      vyos_facts:\r\n        gather_subset:config\r\n\r\n    - name: collect everything exception the config\r\n      vyos_facts:\r\n        gather_subset: \"!config\"\r\n\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\nI expected to gather the facts similar to the setup module.\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nFrom the playbook it doesn't seem to recognize vyos_facts as a valid module.\r\nFrom the ad hoc commands we get this error:\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n\"\r\nUsing /etc/ansible/ansible.cfg as config file\r\nLoaded callback minimal of type stdout, v2.0\r\n10.10.10.167 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.10.10.168 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.10.10.169 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_facts.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\nsveer@ansible:~$ ANSIBLE_KEEP_REMOTE_FILES=1 ansible -vvvvv all -m vyos_command\r\nUsing /etc/ansible/ansible.cfg as config file\r\nLoaded callback minimal of type stdout, v2.0\r\n10.110.57.167 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_command.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.110.57.168 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_command.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.110.57.169 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_command.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\nsveer@ansible:~$ ANSIBLE_KEEP_REMOTE_FILES=1 ansible -vvvvv all -m vyos_config\r\nUsing /etc/ansible/ansible.cfg as config file\r\nLoaded callback minimal of type stdout, v2.0\r\n10.110.57.168 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_config.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.110.57.167 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_config.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n10.110.57.169 | FAILED! => {\r\n    \"failed\": true, \r\n    \"msg\": \"error importing module in /usr/lib/python2.7/dist-packages/ansible/modules/core/network/vyos/vyos_config.py, expecting format like 'from ansible.module_utils.<lib name> import *'\"\r\n}\r\n\"\r\n```\r\nTroubleshooting steps: I reinstalled my ansible after purging the old version, this is a fresh install from  ppa:ansible/ansible\r\nI added paths to my PYTHONPATH variable, and tried to get more verbose output.\r\nansible-doc does give the vyos_* documentartion"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/259914466","html_url":"https://github.com/ansible/ansible-modules-core/issues/5557#issuecomment-259914466","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5557","id":259914466,"user":{"login":"AlainG80","id":23386162,"avatar_url":"https://avatars.githubusercontent.com/u/23386162?v=3","gravatar_id":"","url":"https://api.github.com/users/AlainG80","html_url":"https://github.com/AlainG80","followers_url":"https://api.github.com/users/AlainG80/followers","following_url":"https://api.github.com/users/AlainG80/following{/other_user}","gists_url":"https://api.github.com/users/AlainG80/gists{/gist_id}","starred_url":"https://api.github.com/users/AlainG80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlainG80/subscriptions","organizations_url":"https://api.github.com/users/AlainG80/orgs","repos_url":"https://api.github.com/users/AlainG80/repos","events_url":"https://api.github.com/users/AlainG80/events{/privacy}","received_events_url":"https://api.github.com/users/AlainG80/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T09:14:04Z","updated_at":"2016-11-11T09:14:04Z","body":"ready_for_review"}}
{"actor":{"display_login":"AlainG80"}}