{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3549","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3549/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3549/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3549/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/3549","id":151116847,"number":3549,"title":"ec2_eip error: 'module' not found","user":{"login":"Dmitry1987","id":9369080,"avatar_url":"https://avatars.githubusercontent.com/u/9369080?v=3","gravatar_id":"","url":"https://api.github.com/users/Dmitry1987","html_url":"https://github.com/Dmitry1987","followers_url":"https://api.github.com/users/Dmitry1987/followers","following_url":"https://api.github.com/users/Dmitry1987/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry1987/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry1987/subscriptions","organizations_url":"https://api.github.com/users/Dmitry1987/orgs","repos_url":"https://api.github.com/users/Dmitry1987/repos","events_url":"https://api.github.com/users/Dmitry1987/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry1987/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-26T12:08:13Z","updated_at":"2016-04-26T12:30:32Z","closed_at":null,"body":"##### 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 plugin/module/task -->\r\nec2_eip\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.1.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\nN/A\r\n\r\n##### SUMMARY\r\nBasic usage of ec2_eip module has failed with error.\r\n\r\n##### STEPS TO REPRODUCE\r\n```\r\n- name: allocate a new elastic IP and associate it with an instance\r\n  ec2_eip: device_id=\"{{ ec2_cms.instance_ids }}\" region=\"{{ global.region }}\"\r\n  register: cms_eip\r\n\r\n- debug: msg=\"Allocated elastic IP for CMS is {{ cms_eip.public_ip }}\"\r\n```\r\n\r\n##### EXPECTED RESULTS\r\nAssociate EIP\r\n\r\n##### ACTUAL RESULTS\r\nError:\r\n```\r\nTASK [ec2-create : allocate a new elastic IP and associate it with an instance] \r\n14:44:03\t\t\ttask path: /var/lib/rundeck/ansible-temp-run/appcloud-ansible/roles/ec2-create/tasks/ec2-cms.yml:22\r\n14:44:04\t\t\tAn exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name 'module' is not defined\r\n14:44:04\t\t\tfatal: [localhost]: FAILED! => {\"changed\": false, \"failed\": true, \"module_stderr\": \"Traceback (most recent call last):\\n  File \\\"/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461671043.7-159857386516552/ec2_eip\\\", line 2705, in <module>\\n    main()\\n  File \\\"/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461671043.7-159857386516552/ec2_eip\\\", line 356, in main\\n    module.check_mode, isinstance=is_instance)\\n  File \\\"/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461671043.7-159857386516552/ec2_eip\\\", line 273, in ensure_present\\n    instance = find_device(ec2, device_id, isinstance=False)\\n  File \\\"/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461671043.7-159857386516552/ec2_eip\\\", line 242, in find_device\\n    module.fail_json(msg=str(e))\\nNameError: global name 'module' is not defined\\n\", \"module_stdout\": \"\", \"msg\": \"MODULE FAILURE\", \"parsed\": false}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/214723633","html_url":"https://github.com/ansible/ansible-modules-core/issues/3549#issuecomment-214723633","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3549","id":214723633,"user":{"login":"Dmitry1987","id":9369080,"avatar_url":"https://avatars.githubusercontent.com/u/9369080?v=3","gravatar_id":"","url":"https://api.github.com/users/Dmitry1987","html_url":"https://github.com/Dmitry1987","followers_url":"https://api.github.com/users/Dmitry1987/followers","following_url":"https://api.github.com/users/Dmitry1987/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry1987/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry1987/subscriptions","organizations_url":"https://api.github.com/users/Dmitry1987/orgs","repos_url":"https://api.github.com/users/Dmitry1987/repos","events_url":"https://api.github.com/users/Dmitry1987/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry1987/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T12:30:32Z","updated_at":"2016-04-26T12:30:32Z","body":"also tried this run:\r\n`\r\n  ec2_eip: device_id={{ ec2_cms.instance_ids }} region={{ global.region }} reuse_existing_ip_allowed=yes  state=present in_vpc=yes\r\n  register: cms_eip\r\n`\r\nwith \"in_vpc=yes\", thought maybe it's the reason for error... but same result."}}