-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdns-azure.yaml
40 lines (37 loc) · 1.19 KB
/
dns-azure.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- name: Test for ManagedCluster Info
gather_facts: false
hosts: localhost
vars:
a_record_ips: []
tasks:
- name: Assert target_clusters is Defined
ansible.builtin.assert:
that:
- azure_dns_resource_group is defined
- azure_dns_zone is defined
- omc_application_dns_label is defined
- target_clusters is defined
- name: Gather Managed Cluster IPs
ansible.builtin.include_tasks:
file: managed-cluster-ips.yaml
loop: "{{ target_clusters }}"
loop_control:
loop_var: target_cluster
- name: Set Azure DNS Records Fact
ansible.builtin.set_fact:
azure_dns_records: |
{{
azure_dns_records | default([]) + [{
'entry': item
}]
}}
loop: "{{ a_record_ips }}"
- name: Update External Azure DNS Record
azure.azcollection.azure_rm_dnsrecordset:
cloud_environment: AzureCloud
records: "{{ azure_dns_records }}"
record_type: A
relative_name: "{{ omc_application_dns_label }}"
resource_group: "{{ azure_dns_resource_group }}"
time_to_live: 30
zone_name: "{{ azure_dns_zone }}"