blob: 7b65e199fbc898ed9e3541d9789f279a54b5b4b4 [file] [log] [blame]
---
- name: Normalized name for public address
cache:
key: 'public_address'
value: '{{ inventory_hostname }}'
- block:
- name: Update cache for public ip on AWS
ec2_metadata_facts:
when: ansible_ec2_public_ipv4 is not defined
- name: Normalized name for public address on AWS
cache:
key: 'public_address'
value: '{{ ansible_ec2_public_ipv4 | default(inventory_hostname) }}'
when: ansible_bios_version is defined and ansible_bios_version | search('amazon')