Hello Guys, 
I want run stopped ec2 instance using count_tag and exact_count and not 
using instance_ids.

- name: launch ec2 instance
  ec2:
    instance_type: m3.medium
    key_name: "{{ec2_key}}"
    group: web
    image: "{{ec2_ami}}"
    vpc_subnet_id: subnet-8c16c0d5
    instance_tags:
      Name: "{{ec2_hostname}}"
    exact_count: 1
    count_tag:
      Name: "{{ec2_hostname}}"
    region: eu-west-1
    wait: yes
    assign_public_ip: yes
    aws_access_key: "{{aws_access_key}}"
    aws_secret_key: "{{aws_secret_key}}"
    #state: running
  register: ec2
  always_run: yes


using count_tag and exact_count working properly, but it conflict with 
state. 
If I run playbook when instance stopped - I get new instance. 

How to resolve my issue?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5d4b14d0-062b-471f-a85d-4748edec6e1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to