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/a66d04d1-0e92-40c9-9b40-db31ff3380d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to