You didn't actually tell us what error you are getting, however I will
assume it is that you need to wrap your {{ }} tempting code in quotes.
So instead of:
exact_count: {{ item.count }}
You need:
exact_count: "{{ item.count }}"
On Wed, Nov 5, 2014 at 3:06 PM, Erick Vitor de Barros <[email protected]
> wrote:
> Hi !
>
> Sorry for this newbie question...but...what is wrong with this?
>
> ---
> - name: Example of provisioning servers
> hosts: 127.0.0.1
> connection: local
> tasks:
> - name: "Deploying new instances"
> local_action:
> module: ec2
> aws_access_key: THIS IS A SECRET
> aws_secret_key: THIS IS A SECRET
> assign_public_ip: yes
> exact_count: {{ item.count }}
> key_name: search-dev-sa-east-1a
> group_id: sg-00b87865
> region: {{ item.region }}
> zone: {{ item.tag }}
> instance_type: {{ item.type }}
> image: ami-69d26774
> wait: true
> vpc_subnet_id: {{ item.subnet }}
> user_data: "{{ lookup('file', 'userdata_api.txt') }}"
> count_tag:
> search: {{ item.tag }}
>
> instance_tags:
> Name: search-api-{{ item.tag }}-{{ 200 |random(step=5) }}
> team: search
> env: dev
> search: {{ item.tag }}
> chaordic:role: search
> chaordic:product: search
>
> volumes:
> - device_name: /dev/sdb
> device_type: io1
> iops: 500
> volume_size: 50
> delete_on_termination: true
>
> with_items:
> - { region: 'sa-east-1', count: '2', tag: 'search-sa-east-1a',
> zone: 'a' , type: 't2.micro', subnet: 'subnet-9706efe0' }
> - { region: 'sa-east-1', count: '2', tag: 'search-sa-east-1b',
> zone: 'b' , type: 't2.micro', subnet: 'subnet-66f22703' }
>
> Thanks in advance.
>
> --
> 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/CAKz6g-1%2BJhDuBSzq47BLXEr_gPDTOrcT5PFJ6TwXOFUboapxeg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAKz6g-1%2BJhDuBSzq47BLXEr_gPDTOrcT5PFJ6TwXOFUboapxeg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Matt Martz
@sivel
sivel.net
--
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/CAD8N0v9C_q62QE0EpMF5FvyEQtBSmQ3C7e1%2BVtof6eHmOO0MRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.