-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure_gslb.yml
62 lines (59 loc) · 2.29 KB
/
configure_gslb.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
- name: "Configure GSLB Sites"
hosts: "localhost"
connection: "local"
vars_files:
- '{{ "site_" + deployment_site + ".yml" }}'
tasks:
- name: "Retrieve Cluster Configurations"
ansible.builtin.set_fact:
cluster_configs: |
{{ (cluster_configs | default({})) | combine({ item.key:
lookup("vmware.alb.avi",
avi_credentials={"controller": item.value.controller_address,
"username": gslb_account.name,
"password": gslb_account.password,
"api_version": gslb_account.api_version},
obj_type="cluster")}) }}
loop: "{{ gslb_sites | dict2items }}"
- name: "Collate Site Information"
ansible.builtin.include_tasks: collate_gslb_site_info.yml
loop: "{{ gslb_sites | dict2items }}"
loop_control:
loop_var: gslb_site
- name: "Create GSLB Site Configurations"
ansible.builtin.set_fact:
sites: |
{{ (sites | default([])) +
[{
"name": item.key,
"cluster_uuid": cluster_configs[item.key].uuid,
"ip_addresses": node_addresses[item.key],
"member_type": item.value.type,
"username": gslb_account.name,
"password": gslb_account.password,
"enabled": true,
"hm_shard_enabled": false,
"suspend_mode": false,
"dns_vses": dns_vses[item.key]
}] }}
loop: "{{ gslb_sites | dict2items }}"
loop_control:
index_var: site_num
- name: "Configure GSLB"
vmware.alb.avi_gslb:
avi_credentials:
controller: "{{ gslb_sites[gslb_leader_site].controller_address }}"
username: "{{ gslb_account.name }}"
password: "{{ gslb_account.password }}"
api_version: "{{ gslb_account.api_version }}"
tenant: '{{ avi_tenant | default("admin") }}'
name: "Default"
sites: "{{ sites }}"
dns_configs: "{{ gslb_dns_domains }}"
leader_cluster_uuid: "{{ cluster_configs[gslb_leader_site].uuid }}"
is_federated: true
replication_policy:
replication_mode: "REPLICATION_MODE_CONTINUOUS"
send_interval: 15
tenant_scoped: false