{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1987","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1987/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1987/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1987/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/1987","id":146857515,"number":1987,"title":"Add aws_mfa_devices module for multi-factor authentication on AWS","user":{"login":"pwnall","id":11460,"avatar_url":"https://avatars.githubusercontent.com/u/11460?v=3","gravatar_id":"","url":"https://api.github.com/users/pwnall","html_url":"https://github.com/pwnall","followers_url":"https://api.github.com/users/pwnall/followers","following_url":"https://api.github.com/users/pwnall/following{/other_user}","gists_url":"https://api.github.com/users/pwnall/gists{/gist_id}","starred_url":"https://api.github.com/users/pwnall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwnall/subscriptions","organizations_url":"https://api.github.com/users/pwnall/orgs","repos_url":"https://api.github.com/users/pwnall/repos","events_url":"https://api.github.com/users/pwnall/events{/privacy}","received_events_url":"https://api.github.com/users/pwnall/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/community_review","name":"community_review","color":"fad8c7"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/new_plugin","name":"new_plugin","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-08T08:29:43Z","updated_at":"2016-05-09T14:08:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/1987","html_url":"https://github.com/ansible/ansible-modules-extras/pull/1987","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/1987.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/1987.patch"},"body":"##### ISSUE TYPE\r\n - New Module Pull Request\r\n\r\n##### COMPONENT NAME\r\naws_mfa_devices\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.0.1.0\r\n```\r\n\r\n##### SUMMARY\r\nAmazon's [GetSessionToken API](http://docs.aws.amazon.com/STS/latest/APIReference/API_GetSessionToken.html), as well as the \r\n[AssumeRole API](http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) behind the [sts_assume_role module](http://docs.ansible.com/ansible/sts_assume_role_module.html) require a MFA token serial number.\r\n\r\nThis module can be used to obtain the serial numbers for all the user's MFA devices, and can be combined with a `prompt` to obtain all the information for the APIs listed above.\r\n\r\nI tested my code with the following rules:\r\n\r\n```\r\n- name: list MFA devices\r\n  aws_mfa_devices:\r\n    region: \"{{ aws_region }}\"\r\n  register: mfa_devices\r\n\r\n- debug: var=mfa_devices\r\n```\r\n\r\nOutput:\r\n```\r\nok: [localhost] => {\r\n    \"mfa_devices\": {\r\n        \"changed\": true,\r\n        \"devices\": [\r\n            {\r\n                \"enable_date\": \"2016-03-11T23:25:36+00:00\",\r\n                \"serial_number\": \"arn:aws:iam::085120003701:mfa/victor_costan\",\r\n                \"user_name\": \"victor_costan\"\r\n            }\r\n        ]\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/217874396","html_url":"https://github.com/ansible/ansible-modules-extras/pull/1987#issuecomment-217874396","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/1987","id":217874396,"user":{"login":"gregdek","id":252125,"avatar_url":"https://avatars.githubusercontent.com/u/252125?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdek","html_url":"https://github.com/gregdek","followers_url":"https://api.github.com/users/gregdek/followers","following_url":"https://api.github.com/users/gregdek/following{/other_user}","gists_url":"https://api.github.com/users/gregdek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdek/subscriptions","organizations_url":"https://api.github.com/users/gregdek/orgs","repos_url":"https://api.github.com/users/gregdek/repos","events_url":"https://api.github.com/users/gregdek/events{/privacy}","received_events_url":"https://api.github.com/users/gregdek/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T14:08:18Z","updated_at":"2016-05-09T14:08:18Z","body":"@pwnall will put into the agenda for our upcoming new module review meeting."}}