Hi 

i have trying to create several ec2 instances and 4 volumes for each 
instance, and i had trouble with it, here is part of it:

create several instances :

  - name: Launch instances
      local_action:
          module: ec2
          image: "{{ image }}"
          instance_type: "{{ instance_type }}"
          keypair: "{{ keypair }}"
          instance_tags: '{ "Name":"{{ hostname }}" , 
"Group":"nginx_backend" }'
          region: "{{ region }}"
          group: "{{ group }}"
          zone: "{{ zone }}"
          wait: "true"
          spot_wait_timeout: 300
          count: "{{count}}"
      register: ec2

and now upon that create for each instance several volumes 

    - name: Create Volume
      local_action:
         module: ec2_vol
         instance: "{{ item.id }}"
         device_name: "/dev/xvd{{ item.1 }}"
         region: "{{ region }}"
         zone: "{{ zone }}"
         volume_size: "{{volume_size}}"
         volume_type: "gp2" 
      with_items: ec2.instances
      register: ec2_vol          

so i have tried to add with_together ...

     with_together:
        - [ 'd', 'e', 'f' , 'g' ]

and seems that with_items and with_together are not working together , i 
have tried with_nested and other issue as loop, nothing work.

who can help me here? 

i will be very appreciated....:-) 

Igal  

-- 
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/9de17398-b19e-44e5-ae4e-8b1f9ca4daed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to