Complex conditionals in retry-until

I have the following ec2 task:


# Provision EC2 instances using variables set in the role vars file
- name: Provision EC2 instances
ec2:
assign_public_ip: yes
aws_access_key: "{{ aws_akey }}"
aws_secret_key: "{{ aws_skey }}"
count_tag:
inventory_group: "{{ item.group | default('') }}"
inventory_host: "{{ item.name }}"
Name: "{{ item.name }}"
exact_count: 1
group: "{{ item.security_group | default('') }}"
key_name: "{{ key_pair_name }}"
image: "{{ item.image_id }}"
instance_tags:
inventory_group: "{{ item.group | default('') }}"
inventory_host: "{{ item.name }}"
Name: "{{ item.name }}"
role: "{{ item.group | default('') }}"
instance_type: "{{ item.type }}"
monitoring: no
region: "{{ region }}"
vpc_subnet_id: "{{ vpc_subnet_id }}"
wait: no
zone: "{{ region }}{{ zone_letter }}"
register: created_instances
with_items:
- [ "{{ instance_master }}" ]
- "{{ instance_slaves }}"

However now and again this seems to yield some or all elements of created_instances.results with public_ip=null, therefore I’d like to retry-until. However I can’t figure out how to write an until option for this. If pure python was possible it would look something like:

until: all([result.tagged_instances[0].public_ip != null for result in created_instances.results])

retries: 10
delay: 0

Is there any way to handle this?