Skip to content

Commit

Permalink
VBoxGuestAdditions
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Dec 16, 2024
1 parent e95804b commit 4d4eea4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Vagrant.configure(2) do |config|
"--audio-driver", "none",
"--cpus", guest['cpus'],
"--memory", guest['memory'],
"--natnet1", "192.168.33.0/24",
"--natnet1", "192.168.33.0/24",
"--graphicscontroller", "VMSVGA",
"--vram", "64"
]
Expand Down
7 changes: 7 additions & 0 deletions files/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -x

# minimize disk usage
echo 'Clean up yum cache'
yum clean all
echo "Remove temporary files used to build box"
rm -rf /tmp/packer-provisioner-ansible-local /var/tmp/dnf-packer-*
0 vagrant.sh → files/vagrant.sh
100644 → 100755
File renamed without changes.
0 vmtools.sh → files/vmtools.sh
100644 → 100755
File renamed without changes.
13 changes: 11 additions & 2 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ build {
provisioner "shell" {
except = ["azure-arm.controller"]
execute_command = "bash '{{ .Path }}'"
script = "vagrant.sh"
script = "files/vagrant.sh"
}
provisioner "shell" {
except = ["azure-arm.controller"]
execute_command = "bash '{{ .Path }}'"
script = "vmtools.sh"
script = "files/vmtools.sh"
}
provisioner "shell" {
execute_command = "echo 'vagrant' | {{ .Vars }} sudo -S -E bash '{{ .Path }}'"
Expand All @@ -243,6 +243,15 @@ build {
only = ["azure-arm"]
}

provisioner "shell" {
execute_command = "bash '{{ .Path }}'"
script = "files/cleanup.sh"
}

provisioner "shell" {
execute_command = "echo 'vagrant' | {{ .Vars }} sudo -S -E bash '{{ .Path }}'"
scripts = ["controller.sh"]
}
post-processors {
post-processor "vagrant" {
except = ["azure-arm.controller"]
Expand Down

0 comments on commit 4d4eea4

Please sign in to comment.