-
Notifications
You must be signed in to change notification settings - Fork 1
/
VMware-networking.yml
111 lines (97 loc) · 3.12 KB
/
VMware-networking.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
---
- hosts: all
vars:
vcenter_server: "168.1.107.242"
vcenter_user: "[email protected]"
vcenter_pass: "RH[}3y5p"
esxi_username: "root"
esxi_password: "T585Qavq"
esxi_hostname: "esx4.demo.com"
tasks:
# - name: Add a VMware vSwitch0 to a specific host system
# vmware_vswitch:
# hostname: "{{ esxi_hostname }}"
# username: "{{ esxi_username }}"
# password: "{{ esxi_password }}"
# esxi_hostname: "{{ esxi_hostname }}"
# switch_name: vswitch0
# nic_name: vmnic0
# validate_certs: no
# mtu: 9000
# delegate_to: localhost
- name: Add a VMware vSwitch1 to a specific host system
vmware_vswitch:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
switch_name: vSwitch1
nic_name: vmnic1
validate_certs: no
mtu: 9000
delegate_to: localhost
# - name: Add Management Network VM Portgroup
# vmware_portgroup:
# hostname: "{{ esxi_hostname }}"
# username: "{{ esxi_username }}"
# password: "{{ esxi_password }}"
# hosts: "{{ esxi_hostname }}"
# switch_name: vswitch0
# portgroup_name: Management Network
# vlan_id: 0
# delegate_to: localhost
- name: Add Private Network VM Portgroup
vmware_portgroup:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
hosts: "{{ esxi_hostname }}"
switch_name: vSwitch0
validate_certs: no
portgroup_name: VM-Private
vlan_id: 0
delegate_to: localhost
- name: Add Private Network VM Portgroup
vmware_portgroup:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
hosts: "{{ esxi_hostname }}"
switch_name: vSwitch0
validate_certs: no
portgroup_name: VMkernel
vlan_id: 0
delegate_to: localhost
- name: Add Management vmkernel port using DHCP network type
vmware_vmkernel:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
# hosts: "{{ esxi_hostname }}"
vswitch_name: vSwitch0
validate_certs: no
portgroup_name: VMkernel
enable_vmotion: yes
enable_vsan: yes
enable_mgmt: yes
enable_ft: yes
vlan_id: 0
state: present
network:
type: 'dhcp'
enable_mgmt: True
delegate_to: localhost
- name: Add VM-Network VM Portgroup
vmware_portgroup:
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
switch_name: vSwitch1
validate_certs: no
portgroup_name: VM-Public
vlan_id: 0
delegate_to: localhost