-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm-gen.pkr.hcl
42 lines (36 loc) · 1.04 KB
/
vm-gen.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
packer {
required_plugins {
digitalocean = {
version = ">= 1.0.4"
source = "github.com/digitalocean/digitalocean"
}
}
}
source "digitalocean" "template" {
api_token = var.api_token
image = var.image
region = var.region
size = var.size
// SSH information has to be for a new key, not one already associated with your DO account
ssh_username = var.ssh_username
private_networking = var.private_networking
snapshot_name = local.vm_name
monitoring = var.monitoring
tags = var.tags
}
build {
sources = ["source.digitalocean.template"]
// For if we need to put files on the image
// provisioner "file" {
// source = "./scripts"
// destination = "/scripts"
// }
// Run our bootstrapping process
provisioner "shell" {
script = "scripts/bootstrap.sh"
}
// Just a quick proof that we are in fact provisioning with packer and we finished
provisioner "shell" {
inline = ["touch /root/provisioned-by-packer"]
}
}