-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharista-veos.pkr.hcl
102 lines (95 loc) · 3.31 KB
/
arista-veos.pkr.hcl
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
variable "version" {
type = string
default = "unknown"
}
variable "gui_disabled" {
type = bool
default = true
}
variable "boot_time" {
type = string
default = "3m"
}
variable "boot_key_interval" {
type = string
default = "50ms"
}
variable "out_dir" {
type = string
default = "tmp_out"
}
source "qemu" "veos" {
accelerator = "kvm"
cpus = 1
memory = 2048
skip_resize_disk = true
skip_compaction = true
disk_image = true
use_backing_file = false
disk_interface = "ide"
disk_cache = "none"
format = "qcow2"
net_device = "virtio-net"
iso_checksum = "none"
iso_url = "/var/lib/libvirt/images/vEOS.qcow2"
boot_wait = "${var.boot_time}"
boot_key_interval = "${var.boot_key_interval}"
boot_command = [
"admin<enter><wait>",
"zerotouch disable<enter><wait>",
"<wait${var.boot_time}>",
"admin<enter><wait>",
"enable<enter><wait>",
"configure<enter><wait>",
"aaa authorization exec default local<enter><wait>",
"aaa root secret 0 vagrant<enter><wait>",
"username admin privilege 15 role network-admin secret 0 admin<enter><wait>",
"username vagrant privilege 15 role network-admin secret 0 vagrant<enter><wait>",
"username vagrant ssh-key ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key<enter><wait>",
"interface Management 1<enter><wait>",
"no lldp transmit<enter><wait>",
"no lldp receive<enter><wait>",
"ip address dhcp<enter><wait>",
"exit<enter><wait>",
"security pki key generate rsa 2048 default<enter><wait5>",
"security pki certificate generate self-signed default key default parameters common-name Arista<enter><wait>",
"management api http-commands<enter><wait>",
"no shutdown<enter><wait>",
"exit<enter><wait>",
"management api netconf<enter><wait>",
"transport ssh default<enter><wait>",
"exit<enter><wait>",
"exit<enter><wait>",
"management api restconf<enter><wait>",
"transport https default<enter><wait>",
"ssl profile default<enter><wait>",
"port 6040<enter><wait>",
"exit<enter><wait>",
"exit<enter><wait>",
"management api gnmi<enter><wait>",
"transport grpc default<enter><wait>",
"no shutdown<enter><wait>",
"exit<enter><wait>",
"exit<enter><wait>",
"management security<enter><wait>",
"ssl profile default<enter><wait>",
"certificate default key default<enter><wait>",
"exit<enter><wait>",
"exit<enter><wait>",
"end<enter><wait>",
"copy running-config startup-config<enter><wait>",
"bash sudo poweroff<enter><wait>",
"<exit>"
]
headless = "${var.gui_disabled}"
communicator = "none"
vm_name = "veos-${var.version}"
output_directory = "${var.out_dir}"
}
build {
sources = ["source.qemu.veos"]
post-processor "vagrant" {
vagrantfile_template = "src/Vagrantfile"
output = "builds/arista-veos-${var.version}.box"
}
}