{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/871","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/871/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/871/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/871/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/871","id":59319130,"number":871,"title":"ec2 creates new instance if instance not running when using exact_count","user":{"login":"moorereason","id":131056,"avatar_url":"https://avatars.githubusercontent.com/u/131056?v=3","gravatar_id":"","url":"https://api.github.com/users/moorereason","html_url":"https://github.com/moorereason","followers_url":"https://api.github.com/users/moorereason/followers","following_url":"https://api.github.com/users/moorereason/following{/other_user}","gists_url":"https://api.github.com/users/moorereason/gists{/gist_id}","starred_url":"https://api.github.com/users/moorereason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moorereason/subscriptions","organizations_url":"https://api.github.com/users/moorereason/orgs","repos_url":"https://api.github.com/users/moorereason/repos","events_url":"https://api.github.com/users/moorereason/events{/privacy}","received_events_url":"https://api.github.com/users/moorereason/received_events","type":"User","site_admin":false},"labels":[{"id":439056659,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/affects_1.8","name":"affects_1.8","color":"5319e7","default":false},{"id":382351767,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/aws","name":"aws","color":"c5def5","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":132897218,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":414073372,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2015-02-28T01:52:28Z","updated_at":"2016-12-09T19:50:17Z","closed_at":null,"body":"##### Issue Type:\n\nBug Report\n##### Ansible Version:\n\n1.8.2\n##### Environment:\n\nRed Hat 7\n##### Summary:\n\nWhen creating an ec2 instance with exact_count, the module creates new instances if the existing instance is not running.\n##### Steps To Reproduce:\n\nGiven the following example playbook:\n\n``` yaml\n- hosts: localhost\n  connection: local\n  gather_facts: false\n  tasks:\n    - ec2:\n        region: \"{{ aws_region }}\"\n        instance_type: \"{{ aws_instance_type }}\"\n        image: \"{{ aws_image }}\"\n        vpc_subnet_id: \"{{ aws_vpc_subnet_id }}\"\n        group: \"{{ aws_group }}\"\n        key_name: \"{{ aws_keypair }}\"\n        exact_count: 1\n        count_tag:\n          Name: \"{{ item.hostname }}\"\n          Role: \"{{ item.role }}\"\n          Env: \"{{ item.env }}\"\n        instance_tags:\n          Name: \"{{ item.hostname }}\"\n          Role: \"{{ item.role }}\"\n          Env: \"{{ item.env }}\"\n        volumes:\n          - device_name: /dev/sda1\n            volume_size: 10\n            device_type: gp2 \n        wait: yes\n        wait_timeout: 500\n      with_items: aws_launch\n```\n\nRun the playbook twice, stopping the instance before the second run.\n##### Expected Results:\n\nI expect the second run to return OK without creating a new instance.\n##### Actual Results:\n\nModule creates a second instance.\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/266106062","html_url":"https://github.com/ansible/ansible-modules-core/issues/871#issuecomment-266106062","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/871","id":266106062,"user":{"login":"ansibot","id":6585283,"avatar_url":"https://avatars.githubusercontent.com/u/6585283?v=3","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T19:50:17Z","updated_at":"2016-12-09T19:50:17Z","body":"This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible\n\nPlease read through the <a href=\"http://docs.ansible.com/ansible/dev_guide/repomerge.html#move-issues-and-prs-to-new-repo\">repomerge</a> page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.\n\n<!-- boilerplate: repomerge -->"}}
{"actor":{"display_login":"ansibot"}}