Skip to content

Commit ea6d238

Browse files
committed
Install ifupdown
1 parent 8aaaae4 commit ea6d238

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

debian.pkr.hcl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,21 @@ build {
4444
"SSH_PORT=${build.Port}"]
4545
}
4646

47+
# disable cloud-init
4748
provisioner "shell" {
4849
inline = [
4950
"echo 'GRUB_CMDLINE_LINUX=\"cloud-init=disabled\"' | tee -a /etc/default/grub",
50-
"update-grub"
51+
"update-grub",
52+
"touch /etc/cloud/cloud-init.disabled"
53+
]
54+
}
55+
56+
# enable DHCP
57+
provisioner "shell" {
58+
inline = [
59+
"apt-get update",
60+
"apt-get install -y ifupdown",
61+
"rm -f /etc/netplan/50-cloud-init.yaml"
5162
]
5263
}
5364

ubuntu.pkr.hcl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,21 @@ build {
4444
"SSH_PORT=${build.Port}"]
4545
}
4646

47+
# disable cloud-init
4748
provisioner "shell" {
4849
inline = [
4950
"echo 'GRUB_CMDLINE_LINUX=\"cloud-init=disabled\"' | tee -a /etc/default/grub",
50-
"update-grub"
51+
"update-grub",
52+
"touch /etc/cloud/cloud-init.disabled"
53+
]
54+
}
55+
56+
# enable DHCP
57+
provisioner "shell" {
58+
inline = [
59+
"apt-get update",
60+
"apt-get install -y ifupdown",
61+
"rm -f /etc/netplan/50-cloud-init.yaml"
5162
]
5263
}
5364

0 commit comments

Comments
 (0)