# Loop on Route53 with items

**URL:** <https://forum.ansible.com/t/loop-on-route53-with-items/18542>\
**Category:** Ansible Project\
**Created:** [June 18, 2015, 2:56pm UTC](https://forum.ansible.com/t/loop-on-route53-with-items/18542 "2015-06-18T14:56:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis\_Borsu](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@Louis\_Borsu](https://forum.ansible.com/u/Louis_Borsu)\
**Post date:** [June 18, 2015, 2:56pm UTC](https://forum.ansible.com/t/loop-on-route53-with-items/18542/1 "2015-06-18T14:56:03Z")

</div>

Hi,

I would like to loop on items in an inventory group with the module Route53

I tried to methods but both failed, if you have any idea, it would be really appreciated 😃

Method 1:

> - route53:  
> command: create  
> overwrite: True  
> zone: “{{ slaves\_dns\_zone }}”  
> record: “{{ item | regex\_replace(‘/.’, ‘-’) }}.{{ slaves\_dns\_record }}”  
> type: PTR  
> ttl: 300  
> value: “{{ item }}”  
> with\_items: groups[‘slaves-private’]

> msg: unsupported parameter for module: with\_items

Method 2:

> - include: route53-unique-slave.yml item=item  
> with\_dict: groups[‘mesos-slaves’]

> ERROR: [DEPRECATED]: include + with\_items is a removed deprecated feature. Please update your playbooks.

Then, I’m a bit out if idea 🙂

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Yassen\_Damyanov](https://avatars.discourse-cdn.com/v4/letter/y/9fc29f/32.png) [@Yassen\_Damyanov](https://forum.ansible.com/u/Yassen_Damyanov)\
**Post date:** [June 21, 2015, 8:22am UTC](https://forum.ansible.com/t/loop-on-route53-with-items/18542/2 "2015-06-21T08:22:44Z")

</div>

Never had to deal with Amazon stuff but here my 2 cents: your first method fails because of wrong indentation:

> Hi,
> 
> I would like to loop on items in an inventory group with the module Route53
> 
> I tried to methods but both failed, if you have any idea, it would be really appreciated 😃
> 
> Method 1:
> 
> > - route53:  
> > command: create  
> > overwrite: True  
> > zone: “{{ slaves\_dns\_zone }}”  
> > record: “{{ item | regex\_replace(‘/.’, ‘-’) }}.{{ slaves\_dns\_record }}”  
> > type: PTR  
> > ttl: 300  
> > value: “{{ item }}”  
> > with\_items: groups[‘slaves-private’]
> 
> > msg: unsupported parameter for module: with\_items

You need to outdent the with\_items clause, otherwise you state it is part of route53 arguments. Here a working example:

`

- name: important basic packages  
apt:  
name: “{{ item }}”  
state: present  
with\_items:
- strace
- screen
- less
- man-db
- wget

`

HTH,  
-Y

---

<div class="post-metadata">

**Author:** ![Louis\_Borsu](https://avatars.discourse-cdn.com/v4/letter/l/bb73d2/32.png) [@Louis\_Borsu](https://forum.ansible.com/u/Louis_Borsu)\
**Post date:** [June 22, 2015, 12:06pm UTC](https://forum.ansible.com/t/loop-on-route53-with-items/18542/3 "2015-06-22T12:06:30Z")

</div>

OK, it worked, thank you =\> _FACEPALM_
