-
Notifications
You must be signed in to change notification settings - Fork 1
/
create_avi_cloud.yml
123 lines (116 loc) · 3.81 KB
/
create_avi_cloud.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
- hosts: localhost
connection: local
vars_files:
- vars/creds.yml
roles:
- role: avinetworks.avisdk
tasks:
#todo: rewrite task below and replace vars by content to simplify
- name: Setting up cloud
debug: msg="{{ AviCloudName }}"
- name: Avi Cloud | Setup VMWare Cloud with Write Access + SE Group
include_role:
name: avinetworks.aviconfig
vars:
avi_config_file: "cloud_config.yml"
avi_creds_file: "vars/creds.yml"
#configure (hidden) management VRF
- name: Configure mgmt vrf
avi_vrfcontext:
api_version: "{{ api_version }}"
avi_credentials: "{{ avi_credentials }}"
name: management #hidden vrf
#avi_api_update_method: patch
#avi_api_patch_op: add
system_default: true
cloud_ref: "/api/cloud/?name={{ AviCloudName }}"
tenant_ref: '/api/tenant/?name=admin'
static_routes:
-
next_hop:
addr: "{{ mgmt_dgw }}"
type: V4
prefix:
ip_addr:
addr: 0.0.0.0
type: V4
mask: '0'
route_id: '1'
# Management Network for Cloud
- name: Config Admin Network
avi_network:
api_version: "{{ api_version }}"
avi_credentials: "{{ avi_credentials }}"
name: "{{ mgmt_network }}"
vrf_context_ref: '/api/vrfcontext/?name=global'
tenant_ref: '/api/tenant/?name=admin'
cloud_ref: "/api/cloud/?name={{ AviCloudName }}"
configured_subnets:
- prefix:
ip_addr:
type: V4
addr: "{{ mgmt_subnet }}"
mask: "{{ mgmt_subnet_mask }}"
static_ranges:
- begin:
type: V4
addr: "{{ mgmt_start_addr }}"
end:
type: V4
addr: "{{ mgmt_end_addr }}"
exclude_discovered_subnets: false
dhcp_enabled: false
#vcenter_dvs: true
# reconfigure Cloud with Management Network
- name: reconfigure Cloud
avi_cloud:
api_version: "{{ api_version }}"
avi_credentials: "{{ avi_credentials }}"
name: "{{ AviCloudName }}"
vtype: CLOUD_VCENTER
tenant_ref: '/api/tenant/?name=admin'
dhcp_enabled: false
license_type: "LIC_CORES"
apic_mode: true
apic_configuration:
se_tunnel_mode: true
apic_password: "{{ apic_password }}"
apic_username: "{{ apic_username }}"
context_aware: "SINGLE_CONTEXT"
apic_admin_tenant: "common"
apic_domain: "{{ apic_VMM }}"
apic_name:
- "{{ apic_ip }}"
vcenter_configuration:
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
datacenter: "{{ vcenter_dc }}"
management_network: "/api/vimgrnwruntime?name={{ mgmt_network }}"
privilege: "WRITE_ACCESS"
vcenter_url: "{{ vcenter_ip }}"
management_ip_subnet:
mask: "{{ mgmt_subnet_mask }}"
ip_addr:
type: V4
addr: "{{ mgmt_subnet }}"
# configure Service Engine Group
- name: Configure Service Engine Group
tags: SEG
avi_serviceenginegroup:
api_version: "{{ api_version }}"
avi_credentials: "{{ avi_credentials }}"
name: "{{ SEgroupname }}"
cloud_ref: "/api/cloud?name={{ AviCloudName }}"
vcenter_folder: "{{ vcenter_folder }}"
se_name_prefix: avi
#vcenter_clusters:
# cluster_refs:
# - '/api/vimgrclusterruntime?name=Arista'
# include: True
realtime_se_metrics:
duration: 0
enabled: true
max_se: 4
buffer_se: 0
min_scaleout_per_vs: 1
max_scaleout_per_vs: 4