-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_horizon_L7_L4.yml
139 lines (139 loc) · 4.96 KB
/
create_horizon_L7_L4.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Author Remo Mattei
# Email: [email protected]
# This playbook configures all objects required for Horizon deployment in a L7+L4 VS with shared VIP.
# Playbook configures HealthMonitor, pools and Virtual Services.
# The Application profile and UDP profile are only available from 18.2.7
---
- hosts: localhost
connection: local
roles:
- avinetworks.avisdk
tasks:
- name: hm_config
vars:
avi_healthmonitor:
avi_credentials: "{{ avi_credentials }}"
monitor_port: 443
https_monitor:
http_request: "HEAD /favicon.ico HTTP/1.0"
http_response_code:
- HTTP_2XX
ssl_attributes:
ssl_profile_ref: "/api/sslprofile?name={{ SSL_PROFILE }}"
ssl_key_and_certificate_ref: "/api/sslkeyandcertificate?name={{ HORIZON_CERT }}"
name: "{{ HORIZON_HM }}"
receive_timeout: 10
failed_checks: 3
send_interval: 30
type: HEALTH_MONITOR_HTTPS
- name: Configuring IP Group with UAG as members
avi_ipaddrgroup:
avi_credentials: "{{ avi_credentials }}"
name: "{{ IP_GROUP }}"
addrs:
- addr: "{{ POOL_SERVER1 }}"
type: V4
- name: Configuring pool for Blast/PCoIP
avi_pool:
avi_credentials: "{{ avi_credentials }}"
cloud_ref: "/api/cloud?name={{ CLOUD_NAME }}"
lb_algorithm: LB_ALGORITHM_CONSISTENT_HASH
lb_algorithm_hash: LB_ALGORITHM_CONSISTENT_HASH_SOURCE_IP_ADDRESS
default_server_port: 443
use_service_port: true
health_monitor_refs:
- "/api/healthmonitor?name={{ HORIZON_HM }}"
ipaddrgroup_ref: "/api/ipaddrgroup?name={{ IP_GROUP }}"
placement_networks:
- subnet:
ip_addr:
addr: "{{ IPADDR_PLACEMENT }}"
type: V4
mask: "{{ SUBNET_MASK }}"
network_ref: "/api/network?name={{ MGMT_NET }}"
name: "{{ L4_POOL }}"
- name: Configuring pool for Primary HTTPS/XML-API
vars:
avi_pool:
avi_credentials: "{{ avi_credentials }}"
cloud_ref: "/api/cloud?name={{ CLOUD_NAME }}"
lb_algorithm: LB_ALGORITHM_CONSISTENT_HASH
lb_algorithm_hash: LB_ALGORITHM_CONSISTENT_HASH_SOURCE_IP_ADDRESS
default_server_port: 443
ssl_profile_ref: "/api/sslprofile?name={{ SSL_PROFILE }}"
health_monitor_refs:
- "/api/healthmonitor?name={{ HORIZON_HM }}"
ipaddrgroup_ref: "/api/ipaddrgroup?name={{ IP_GROUP }}"
placement_networks:
- subnet:
ip_addr:
addr: "{{ IPADDR_PLACEMENT }}"
type: V4
mask: "{{ SUBNET_MASK }}"
network_ref: "/api/network?name={{ MGMT_NET }}"
name: "{{ L7_POOL }}"
- name: Configuring L7 Virtual Service for HTTPS/XML-API
vars:
avi_virtualservice:
avi_credentials: "{{ avi_credentials }}"
name: "{{ L7_VS }}"
services:
- port: 443
enable_ssl: true
pool_ref: "/api/pool?name={{ L7_POOL }}"
ssl_profile_ref: "/api/sslprofile?name={{ SSL_PROFILE }}"
ssl_key_and_certificate_refs: "/api/sslkeyandcertificate?name={{ HORIZON_CERT }}"
application_profile_ref: "/api/applicationprofile?name={{ APP_PROFILE }}"
network_profile_ref: "/api/networkprofile?name={{ TCP_PROFILE }}"
cloud_ref: "/api/cloud?name={{ CLOUD_NAME }}"
se_group_ref: "/api/serviceenginegroup/?name={{ HORIZON_SE }}"
vip:
- ip_address:
addr: "{{ IP_VIP }}"
type: V4
placement_networks:
- subnet:
ip_addr:
addr: "{{ IPADDR_PLACEMENT }}"
type: V4
mask: "{{ SUBNET_MASK }}"
network_ref: "/api/network?name={{ MGMT_NET }}"
analytics_policy:
all_headers: True
client_insights: NO_INSIGHTS
full_client_logs:
duration: 0
enabled: True
throttle: 10
metrics_realtime_update:
duration: 0
enabled: True
significant_log_throttle: 10
udf_log_throttle: 10
dns_info:
- fqdn: "{{ DOMAIN_NAME }}"
- name: Getting shared VIP id
avi_api_session:
avi_credentials: "{{ avi_credentials }}"
http_method: get
path: virtualservice/?name={{ L7_VS }}
register: vs_data
- name: Configuring L4 Virtual Service for Blast/PCoIP
avi_virtualservice:
avi_credentials: "{{ avi_credentials }}"
name: "{{ L4_VS }}"
se_group_ref: "/api/serviceenginegroup/?name={{ HORIZON_SE }}"
services:
- port: 8443
- port: 8443
override_network_profile_ref: "/api/networkprofile?name={{ UDP_PROFILE }}"
- port: 4172
- port: 4172
override_network_profile_ref: "/api/networkprofile?name={{ UDP_PROFILE }}"
- port: 443
override_network_profile_ref: "/api/networkprofile?name={{ UDP_PROFILE }}"
application_profile_ref: "/api/applicationprofile?name={{ L4_APP_PROFILE }}"
network_profile_ref: "/api/networkprofile?name={{ TCP_PROFILE }}"
cloud_ref: "/api/cloud?name={{ CLOUD_NAME }}"
pool_ref: "/api/pool?name={{ L4_POOL }}"
vsvip_ref: "{{ vs_data['obj']['results'][0]['vsvip_ref'] }}"