-
Notifications
You must be signed in to change notification settings - Fork 0
/
configGslbdomain.yml
117 lines (105 loc) · 3.66 KB
/
configGslbdomain.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
- hosts: localhost
connection: local
vars_files: "{{ var_file }}"
#- vars/env_vars.yml
vars:
avi_credentials_site_a:
username: "{{ username }}"
password: "{{ password }}"
controller: "{{ cluster_leader_ip_site_a }}"
avi_credentials_site_b:
username: "{{ username }}"
password: "{{ password }}"
controller: "{{ cluster_leader_ip_site_b }}"
roles:
- avinetworks.avisdk
tasks:
- name: Get the Avi version information
avi_api_version:
avi_credentials: "{{ avi_credentials_site_a }}"
register: avi_version
- name: Wait for Controller be ready
uri:
validate_certs: False
url: "http://{{ cluster_leader_ip_site_a }}/"
method: GET
status_code: 200,302,301,503
register: statusCode_output
until: statusCode_output.status == 200
retries: 120
delay: 60
- name: Get Cluster UUIDs on Controller site A
avi_api_session:
avi_credentials: "{{ avi_credentials_site_a }}"
api_version: "{{ avi_version.obj.version }}"
http_method: get
path: "cluster/"
register: cluster_data_site_a
- name: Get Cluster UUIDs on Controller Site B
avi_api_session:
avi_credentials: "{{ avi_credentials_site_b }}"
api_version: "{{ avi_version.obj.version }}"
http_method: get
path: "cluster/"
register: cluster_data_site_b
- name: Get DNS VS UUID Details Site A
avi_api_session:
avi_credentials: "{{ avi_credentials_site_a }}"
api_version: "{{ avi_version.obj.version }}"
http_method: get
path: virtualservice
params:
name: "{{ dns_vs_name }}"
register: dns_vs_site_a
- name: Get DNS VS UUID Details Site B
avi_api_session:
avi_credentials: "{{ avi_credentials_site_b }}"
api_version: "{{ avi_version.obj.version }}"
http_method: get
path: virtualservice
params:
name: "{{ dns_vs_name }}"
register: dns_vs_site_b
- name: Configuring GSLB Subdomain
avi_gslb:
avi_credentials: "{{ avi_credentials_site_a }}"
api_version: "{{ avi_version.obj.version }}"
name: "{{ gslb_subdoamin }}"
sites:
- username: "{{ username }}"
name: "{{ site_1_name }}"
ip_addresses:
- type: V4
addr: "{{ site_1_ipaddress }}"
enabled: true
member_type: GSLB_ACTIVE_MEMBER
cluster_uuid: "{{ cluster_data_site_a['obj'].uuid }}"
hm_shard_enabled: false
password: "{{ password }}"
port: 443
dns_vses:
- dns_vs_uuid: "{{ dns_vs_site_a['obj']['results'][0]['uuid'] }}"
domain_names:
- "{{ gslb_domain_name }}"
- username: "{{ username }}"
name: "{{ site_2_name }}"
ip_addresses:
- type: V4
addr: "{{ site_2_ipaddress }}"
enabled: true
member_type: GSLB_ACTIVE_MEMBER
cluster_uuid: "{{ cluster_data_site_b['obj'].uuid }}"
hm_shard_enabled: false
password: "{{ password }}"
port: 443
dns_vses:
- dns_vs_uuid: "{{ dns_vs_site_b['obj']['results'][0]['uuid'] }}"
domain_names:
- "{{ gslb_domain_name }}"
third_party_sites:
enabled: true
name: ee
dns_configs:
- domain_name: "{{ gslb_domain_name }}"
leader_cluster_uuid: "{{ cluster_data_site_a['obj'].uuid }}"