---
- name: "Create Route53 CNAME record for master public ELB"
  route53:
    command: create
    overwrite: yes
    private_zone: no
    record: "master.{{ r53zoneext.result.name }}"
    type: CNAME
    ttl: 300
    value: "{{ elbextmaster.elb.dns_name }}"
    zone: "{{ r53zoneext.result.name }}"

- name: "Create Route53 CNAME record for master private ELB"
  route53:
    command: create
    overwrite: yes
    private_zone: yes
    record: "master.{{ r53zoneint.result.name }}"
    type: CNAME
    ttl: 300
    value: "{{ elbintmaster.elb.dns_name }}"
    zone: "{{ r53zoneint.result.name }}"

- name: "Create Route53 wildcard CNAME record (external)"
  route53:
    command: create
    overwrite: yes
    private_zone: no
    record: "*.apps.{{ clusterid }}.{{ dns_domain }}"
    type: CNAME
    ttl: 300
    value: "{{ elbextinfra.elb.dns_name }}"
    zone: "{{ r53zoneext.result.name }}"

- name: "Create Route53 wildcard CNAME record (internal)"
  route53:
    command: create
    overwrite: yes
    private_zone: no
    record: "*.apps.{{ clusterid }}.{{ dns_domain }}"
    type: CNAME
    ttl: 300
    value: "{{ elbextinfra.elb.dns_name }}"
    zone: "{{ r53zoneint.result.name }}"
