-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontroller_cluster.yml
42 lines (42 loc) · 1.17 KB
/
controller_cluster.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
# Author Remo Mattei
# Email: [email protected]
---
- hosts: localhost
connection: local
roles:
- role: avinetworks.avisdk
tasks:
- name: Create the node payload
set_fact:
node:
ip:
type: V4
addr: "{{ item }}"
name: "{{ item }}"
loop:
- "{{ controllers.0.mgmt_ip }}"
- "{{ controllers.1.mgmt_ip }}"
- "{{ controllers.2.mgmt_ip }}"
register: node_result
- name: Create a list of nodes
set_fact:
nodes : "{{ node_result.results | map(attribute='ansible_facts.node')| list }}"
- debug: var=nodes
- name: Configure Avi Controller Clusters
avi_api_session:
controller: "{{ controllers.0.mgmt_ip }}"
username: "{{ username }}"
password: "{{ password }}"
api_version: "{{ api_version }}"
http_method: put
path: cluster
data:
tenant_uuid: "admin"
name: "{{ cluster_name }}"
virtual_ip:
type: V4
addr: "{{ cluster_IP }}"
nodes: "{{ nodes }}"
register: ccluster
- debug:
msg: "Result Register : {{ ccluster }}, This may take a few min!!"