forked from llima3000/ansibledevops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformCluster.yml
54 lines (50 loc) · 1.39 KB
/
formCluster.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
- hosts: localhost
connection: local
roles:
- { role: avinetworks.avisdk }
vars:
# common vars
controller: 10.10.29.250
cluster_name: Avi_Cluster
cluster_vip: 10.10.29.249
cluster_node2: 10.10.29.251
cluster_node3: 10.10.29.252
api_version: 17.2.7
avi_credentials:
username: admin
password: Avi123$%
controller: "{{ controller }}"
tasks:
- name: Get main Cluster Information
avi_api_session:
avi_credentials: "{{ avi_credentials }}"
api_version: "{{ api_version }}"
http_method: get
path: cluster
register: cluster_info
- name: Configure Cluster object
avi_cluster:
controller: "{{ controller }}"
avi_credentials: "{{ avi_credentials }}"
api_version: "{{ api_version }}"
nodes:
-
name: "{{ controller }}"
ip:
type: V4
addr: "{{ controller }}"
-
name: "{{ cluster_node2 }}"
ip:
type: V4
addr: "{{ cluster_node2 }}"
-
name: "{{ cluster_node3 }}"
ip:
type: V4
addr: "{{ cluster_node3 }}"
name: "{{ cluster_name }}"
uuid: "{{ cluster_info['obj'].uuid }}"
virtual_ip:
addr: "{{ cluster_vip }}"
type: V4