forked from Ard3ny/proxmox-build-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian-ci.pkr.hcl
99 lines (77 loc) · 1.88 KB
/
debian-ci.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
variable "proxmox_host_node" {
type = string
default = "pve"
}
variable "proxmox_source_template" {
type = string
default = "debian-temp"
}
variable "proxmox_template_name" {
type = string
default = "debian-template"
}
variable "proxmox_api_url" {
type = string
}
# token/secret auth method
variable "proxmox_api_token_id" {
type = string
}
variable "proxmox_api_token_secret" {
type = string
sensitive = true
}
#If you want to use username/password instead of token
#variable "proxmox_api_username" {
# type = string
# default = "root@pve"
#}
#variable "proxmox_api_password" {
# type = string
# sensitive = true
#}
variable "proxmox_network_bridge" {
type = string
default = "vmbr0"
}
packer {
required_plugins {
proxmox = {
version = " >= 1.0.1"
source = "github.com/hashicorp/proxmox"
}
}
}
source "proxmox-clone" "debian" {
insecure_skip_tls_verify = true
full_clone = false
template_name = "${var.proxmox_template_name}"
template_description = "Built at ${timestamp()} by Packer"
clone_vm = "${var.proxmox_source_template}"
os = "l26"
cores = "1"
memory = "1024"
scsi_controller = "virtio-scsi-pci"
vm_id = "8000"
ssh_username = "packer"
ssh_timeout = "10m"
qemu_agent = true
network_adapters {
bridge = "${var.proxmox_network_bridge}"
model = "virtio"
}
node = "${var.proxmox_host_node}"
#username/passwort auth method
#username = "${var.proxmox_api_username}"
#password = "${var.proxmox_api_password}"
#token ID / secret auth method
username = "${var.proxmox_api_token_id}"
token = "${var.proxmox_api_token_secret}"
proxmox_url = "${var.proxmox_api_url}"
}
build {
sources = ["source.proxmox-clone.debian"]
provisioner "shell" {
script = "bin/bootstrap_deb.sh"
}
}