Loop on Route53 with items

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 :smiley:

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 :slight_smile:

Thank you in advance!

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 :smiley:

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

OK, it worked, thank you => FACEPALM