block with with_items for bulk DNS registration of hosts?

I have a dictionary of DNS host names that I need to register.

They’re higher level than just a host as I need to do cleanup too of older DNS names.

My idea was to have a block with a look which first tests via ‘dig’ to see if the name is already present, and if not, register the DNS via the dnsimple module

The problem is that blocks don’t support with_items.

At least in 2.2 and I don’t see a note about this being added.

Is it in 2.4? I don’t see any notes about this.

Thoughts?

What is supported is here
https://docs.ansible.com/ansible/latest/playbooks_keywords.html#block

And with_items is not one of them.

You don't need block, you can do this in one task.

Just dnssimple with with_item and use the dig lookup[1] in the when:

[1] https://docs.ansible.com/ansible/latest/playbooks_lookups.html#the-dns-lookup-dig