-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure_dns.yml
84 lines (80 loc) · 3 KB
/
configure_dns.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
---
- name: "Configure DNS Services"
hosts: "localhost"
connection: "local"
vars_files:
- '{{ "site_" + deployment_site + ".yml" }}'
tasks:
- name: "Create DNS VSVip"
vmware.alb.avi_vsvip:
avi_credentials: "{{ avi_credentials }}"
api_context: "{{ avi_api_context | default(omit) }}"
name: '{{ "vsvip-" + dns_config.dns_vs_name + "-" + cloud_parameters.name }}'
cloud_ref: '{{ "/api/cloud/?name=" + cloud_parameters.name }}'
vip:
- enabled: true
auto_allocate_ip: false
ip_address:
addr: "{{ dns_config.dns_vip }}"
type: "V4"
vip_id: "1"
# dns_info:
# - fqdn: "{{ dns_config.dns_vs_name }}"
register: vsvip
- name: "Create DNS Application Profile"
vmware.alb.avi_applicationprofile:
avi_credentials: "{{ avi_credentials }}"
api_context: "{{ avi_api_context | default(omit) }}"
name: Avi-DNS-Profile
dns_service_profile:
aaaa_empty_response: true
admin_email: hostmaster
dns_over_tcp_enabled: true
ecs_stripping_enabled: true
edns: true
edns_client_subnet_prefix_len: 24
error_response: DNS_ERROR_RESPONSE_NONE
negative_caching_ttl: 30
num_dns_ip: 1
ttl: 30
dns_zones: "{{ dns_config.auth_domains | default(omit) }}"
domain_names: "{{ dns_config.valid_domains | default(omit) }}"
type: APPLICATION_PROFILE_TYPE_DNS
register: appprofile
- name: "Create Virtual Service"
vmware.alb.avi_virtualservice:
avi_credentials: "{{ avi_credentials }}"
api_context: "{{ avi_api_context | default(omit) }}"
name: "{{ dns_config.dns_vs_name }}"
vsvip_ref: "{{ vsvip.obj.url }}"
cloud_ref: '{{ "/api/cloud/?name=" + cloud_parameters.name }}'
application_profile_ref: "{{ appprofile.obj.url }}"
services:
- enable_ssl: false
port: 53
- enable_ssl: false
override_network_profile_ref: "/api/networkprofile/?name=System-TCP-Proxy"
port: 53
network_profile_ref: "/api/networkprofile/?name=System-UDP-Per-Pkt"
enabled: true
se_group_ref: "/api/serviceenginegroup/?name=GSLB-Group"
analytics_policy:
all_headers: false
client_insights: NO_INSIGHTS
full_client_logs:
duration: 0
enabled: true
throttle: 20
metrics_realtime_update:
enabled: false
register: dnsvs
- name: "Set System DNS VS Configuration"
vmware.alb.avi_api_session:
avi_credentials: "{{ avi_credentials }}"
api_context: "{{ avi_api_context | default(omit) }}"
http_method: "patch"
path: "systemconfiguration"
data:
replace:
dns_virtualservice_refs:
- "{{ dnsvs.obj.url }}"