Could it be something as easy as (route53.yml)
...
- name: getting & showing all records matchig our stores                   
  
  local_action: route53 command=get zone={{ item.zone }} record={{ item.record 
}} type=A value={{ elasticip.public_ip }}
  with_items:
    - { record: '{{ comhost }}', zone: '{{ zonecom }}', elasticip: '{{ 
eip.results }}' }                                                           
   
    - { record: '{{ athost }}', zone: '{{ zoneat }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ chhost }}', zone: '{{ zonech }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ ukhost }}', zone: '{{ zoneuk }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ frhost }}', zone: '{{ zonefr }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ ithost }}', zone: '{{ zoneit }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ sehost }}', zone: '{{ zonese }}', elasticip: '{{ 
eip.results }}' }                                                           
     
    - { record: '{{ sehost }}', zone: '{{ zonese }}', elasticip: '{{ 
eip.results }}' }                                
  register: dnsrec_get
...

Just exploring potential solutions...

Thanks!


On Thursday, 19 June 2014 18:13:26 UTC+2, Dan Vaida wrote:
>
> Hello everyone!
>
> Since the 'include' doesn't work anymore with 'with_items', I am trying to 
> do the following:
>
> ...
> - name: add EIP to the instance
>   local_action: ec2_eip in_vpc=yes instance_id={{ item.id }} region={{ 
> region }}
>   with_items: ec2.instances
>   register: eip
>
> - name: output the IP
>   debug: msg= "Allocated IP inside the VPC is {{ item.public_ip }}"
>   with_items: eip.results
>
> - name: Update Route53
>   include: route53.yml EIP={{ eip.WhatToPutHere? }}
>   #with_items: eip.results < this is now deprecated
> ...
>
> Here goes my route53.yml
> - name: if we have the records, replace them if they do not match. if we 
> dont have them, just create them.
>   local_action: route53 command=create zone={{ item.zone }} record={{ item
> .record }} type=A value={{ EIP }} overwrite=yes ttl=300
>   with_items:
>     - { record: '{{ comhost }}', zone: '{{ zonecom }}' }
>     - { record: '{{ athost }}', zone: '{{ zoneat }}' }
>     - { record: '{{ chhost }}', zone: '{{ zonech }}' }
>     - { record: '{{ ukhost }}', zone: '{{ zoneuk }}' }
>     - { record: '{{ frhost }}', zone: '{{ zonefr }}' }
>     - { record: '{{ ithost }}', zone: '{{ zoneit }}' }
>     - { record: '{{ sehost }}', zone: '{{ zonese }}' }
>   register: dnsrec_create
>
> Everywhere I look, everyone says "just go for those so many easy ways" to 
> achieve the same thing without the with_items... but after almost a full 
> day of writing playbooks, I might be missing the obvious here :)
>
> I'd like to keep the route53.yml separate from my main playbook.
>
> Any advice is much appreciated.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c7c138ee-8cf8-4e18-a6ce-c99099206018%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to