-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[packer] Handle VBox versions requiring --nat-localhostreachableN
- Loading branch information
1 parent
07ab81f
commit ac0206c
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
if VBoxManage modifyvm --help 2>&1 | grep -q -- --nat-localhostreachableN; then | ||
export ARCH_ANSIBLE_PACKER_VBOX_NAT_LOCALHOST_KEY="--nat-localhostreachable1" | ||
export ARCH_ANSIBLE_PACKER_VBOX_NAT_LOCALHOST_VAL="on" | ||
else | ||
# Since the JSON is static, we must pass something valid into these vars | ||
# but it also has to be idempotent. Just restate that the first NIC is NAT. | ||
export ARCH_ANSIBLE_PACKER_VBOX_NAT_LOCALHOST_KEY="--nic1" | ||
export ARCH_ANSIBLE_PACKER_VBOX_NAT_LOCALHOST_VAL="nat" | ||
fi | ||
|
||
packer "$@" |