Thanks! 

Sorry for the stupid question, I should've looked up a little better :(
I've managed to obtain the behaviour I wanted like this:

my_aws_role/tasks/main.yml
- name: Raise ec2 instance
    ec2:
      key_name: my_key
      instance_type: m1.medium
      image: i999999
      region: us-east-1
      zone: us-east-1e
      wait: 1000
      count_tags: "{{my_tags}}"
*      exact_count: "{{my_count}}"*

my_aws_role/defaults/main.yml
*exact_count: "{{ omit }}"*
my_tags: "{{mandatory}}"

create-instance.yml
- name: Create a pong server
  hosts: localhost:
  vars:
     exact_count: 1
     tags:
       server_app: pong
  roles:
    - my_aws_role


Thank you again!

Em terça-feira, 17 de fevereiro de 2015 13:03:39 UTC-2, Brian Coca escreveu:
>
> try: 
>
>  exact_count: "{{my_count|default(omit)}}" 
>
> --------------- 
> Brian Coca 
>

-- 
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/095951a2-ffdb-47ca-890f-cbf5eeceb69c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to