/
04-vmware_deploy.yaml
95 lines (82 loc) · 3.42 KB
/
04-vmware_deploy.yaml
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
---
- name: Deploy an ISE OVA on VMware ESXi Host
gather_facts: false
hosts: localhost
connection: local
vars_files:
- vars/main.yaml
#--------------------------------------------------------------------------
# This playbook Deploy ISE to an ESXi Host, attach the ztp.iso, and
# power on the VM
#--------------------------------------------------------------------------
tasks:
#--------------------------------------------------------------------------
# 🛈 The `PyVmomi` package is required to run this module.
# Un-comment the `Install Python PyVmomi Package` task below to
# install it.
#--------------------------------------------------------------------------
# - name: Install Python PyVmomi Package
# delegate_to: localhost
# ansible.builtin.pip:
# name: PyVmomi
# executable: pip3
#--------------------------------------------------------------------------
# The example shown here is to install to an ESXi host, you can
# install to vCenter Server as well.
# Specify at least:
# - `datastore` to which you will install the VM
# - `name` VM name
# - `networks` for the NIC(s)
# - `ovf` full path to the ovf or ova file
# - `DeploymentOption.value` selects the size of the VM.
# For this ova, the options are:
# - Eval
# - PSN_Lite
# - small
# - medium
#--------------------------------------------------------------------------
- name: Deploy OVA to ESXi Server
community.vmware.vmware_deploy_ovf:
datastore: '{{ datastore }}'
# name: "VMware-Ansible"
name: chmoreto_ISE-Ansible
networks: "{u'VM Network':u'{{ ProvisioningNetworkLabel }}'}"
power_on: no
ovf: "/mnt/c/wsl/ISE-3.2.0.542-virtual-SNS3615-SNS3655-300.ova"
wait_for_ip_address: true
validate_certs: no
properties:
DeploymentOption.value: 'Eval' # For this OVA, the values are Eval, PSN_Lite, small, medium
delegate_to: localhost
#--------------------------------------------------------------------------
# Attach the ztp.iso to the VM using the full datastore path
# the `datastore` name must be enclosed in [brackets] followed by
# the rest of the path.
# Specify the device to attach the iso: `cdrom`, `controller_number`,
# `unit_number`
#--------------------------------------------------------------------------
- name: Add ZTP info to VM
community.vmware.vmware_guest:
validate_certs: no
name: "VMware-Ansible"
# name: "chmoreto_ISE-Ansible"
state: present
cdrom:
- type: "iso"
iso_path: "[{{ datastore }}] /ISO/ZTP/ise-ztp.iso"
controller_number: 1
unit_number: 1
#--------------------------------------------------------------------------
# Power on the VM
#--------------------------------------------------------------------------
# - name: Power on virtual machine
# community.vmware.vmware_guest_powerstate:
# validate_certs: false
# name: "chmoreto_ISE-Ansible"
# state: powered-on
#--------------------------------------------------------------------------
# Built in pause for any additional tasks
#--------------------------------------------------------------------------
# - name: Pause for 25 seconds for ISE to boot
# ansible.builtin.pause:
# seconds: 25