-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
183 additions
and
350 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo "Shell Provisioner Says What" |
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,21 @@ | ||
os_name = "amazonlinux" | ||
os_version = "2" | ||
os_arch = "x86_64" | ||
vbox_guest_os_type = "RedHat_64" | ||
sources_enabled = [ | ||
"source.virtualbox-ovf.amazonlinux" | ||
] | ||
vboxmanage = [ | ||
[ | ||
"modifyvm", | ||
"{{ .Name }}", | ||
"--memory", | ||
"2048", | ||
"--cpus", | ||
"2", | ||
"--audio", | ||
"none", | ||
"--nat-localhostreachable1", | ||
"on", | ||
] | ||
] |
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,9 @@ | ||
os_name = "centos" | ||
os_version = "7.9" | ||
os_arch = "x86_64" | ||
iso_url = "http://mirrors.kernel.org/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso" | ||
iso_checksum = "file:https://mirrors.edge.kernel.org/centos/7.9.2009/isos/x86_64/sha256sum.txt" | ||
parallels_guest_os_type = "centos" | ||
vbox_guest_os_type = "RedHat_64" | ||
vmware_guest_os_type = "centos-64" | ||
boot_command = ["<wait><up><wait><tab> inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg<enter><wait>"] |
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,9 @@ | ||
os_name = "centos-stream" | ||
os_version = "9" | ||
os_arch = "x86_64" | ||
iso_url = "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso" | ||
iso_checksum = "file:https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso.SHA256SUM" | ||
parallels_guest_os_type = "centos" | ||
vbox_guest_os_type = "RedHat_64" | ||
vmware_guest_os_type = "centos-64" | ||
boot_command = ["<wait><up><wait><tab> inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg<enter><wait>"] |
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
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,47 @@ | ||
#!/bin/sh -eux | ||
|
||
# set a default HOME_DIR environment variable if not set | ||
HOME_DIR="${HOME_DIR:-/home/vagrant}"; | ||
|
||
case "$PACKER_BUILDER_TYPE" in | ||
parallels-iso|parallels-pvm) | ||
major_version="$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}')" | ||
# make sure we use dnf on EL 8+ | ||
if [ "$major_version" -ge 8 ]; then | ||
dnf -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make | ||
else | ||
yum -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make | ||
fi | ||
|
||
mkdir -p /tmp/parallels; | ||
if [ "$(uname -m)" = "aarch64" ] ; then | ||
mount -o loop "$HOME_DIR"/prl-tools-lin-arm.iso /tmp/parallels; | ||
else | ||
mount -o loop "$HOME_DIR"/prl-tools-lin.iso /tmp/parallels; | ||
fi | ||
VER="$(cat /tmp/parallels/version)"; | ||
|
||
echo "Parallels Tools Version: $VER"; | ||
|
||
/tmp/parallels/install --install-unattended-with-deps \ | ||
|| (code="$?"; \ | ||
echo "Parallels tools installation exited $code, attempting" \ | ||
"to output /var/log/parallels-tools-install.log"; \ | ||
cat /var/log/parallels-tools-install.log; \ | ||
exit $code); | ||
umount /tmp/parallels; | ||
rm -rf /tmp/parallels; | ||
rm -f "$HOME_DIR"/*.iso; | ||
|
||
# Parallels Tools for Linux includes native auto-mount script, | ||
# which causes losing some of Vagrant-relative shared folders. | ||
# So, we should disable this behavior. | ||
# https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113 | ||
# TODO: verify this is fixed in latest version of parallels | ||
# auto_mount_script='/usr/bin/prlfsmountd' | ||
# if [ -f "${auto_mount_script}" ]; then | ||
# printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}" | ||
# fi | ||
|
||
;; | ||
esac |
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,39 @@ | ||
#!/bin/sh -eux | ||
|
||
# set a default HOME_DIR environment variable if not set | ||
HOME_DIR="${HOME_DIR:-/home/vagrant}"; | ||
|
||
case "$PACKER_BUILDER_TYPE" in | ||
parallels-iso|parallels-pvm) | ||
mkdir -p /tmp/parallels; | ||
if [ "$(uname -m)" = "aarch64" ] ; then | ||
mount -o loop "$HOME_DIR"/prl-tools-lin-arm.iso /tmp/parallels; | ||
else | ||
mount -o loop "$HOME_DIR"/prl-tools-lin.iso /tmp/parallels; | ||
fi | ||
VER="$(cat /tmp/parallels/version)"; | ||
|
||
echo "Parallels Tools Version: $VER"; | ||
|
||
/tmp/parallels/install --install-unattended-with-deps \ | ||
|| (code="$?"; \ | ||
echo "Parallels tools installation exited $code, attempting" \ | ||
"to output /var/log/parallels-tools-install.log"; \ | ||
cat /var/log/parallels-tools-install.log; \ | ||
exit $code); | ||
umount /tmp/parallels; | ||
rm -rf /tmp/parallels; | ||
rm -f "$HOME_DIR"/*.iso; | ||
|
||
# Parallels Tools for Linux includes native auto-mount script, | ||
# which causes losing some of Vagrant-relative shared folders. | ||
# So, we should disable this behavior. | ||
# https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113 | ||
# TODO: verify this is fixed in latest version of parallels | ||
# auto_mount_script='/usr/bin/prlfsmountd' | ||
# if [ -f "${auto_mount_script}" ]; then | ||
# printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}" | ||
# fi | ||
|
||
;; | ||
esac |
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,4 @@ | ||
#!/bin/sh -eux | ||
|
||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636 | ||
apt-get install libpam-systemd |
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,24 @@ | ||
#!/bin/bash -eux | ||
|
||
# Add pkgadd auto-answer file | ||
sudo mkdir -p /tmp | ||
sudo chmod 777 /tmp | ||
{ | ||
echo "mail=" | ||
echo "instance=overwrite" | ||
echo "partial=nocheck" | ||
echo "runlevel=nocheck" | ||
echo "idepend=nocheck" | ||
echo "rdepend=nocheck" | ||
echo "space=nocheck" | ||
echo "setuid=nocheck" | ||
echo "conflict=nocheck" | ||
echo "action=nocheck" | ||
echo "basedir=default" | ||
} > /tmp/nocheck | ||
|
||
if [ -f /home/vagrant/.vbox_version ]; then | ||
mkdir /tmp/vbox | ||
ls | ||
echo "all" | sudo -i pkgadd -a /tmp/nocheck -d /media/VBOXADDITIONS_*/VBoxSolarisAdditions.pkg | ||
fi |
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,7 @@ | ||
#!/bin/sh -eux | ||
|
||
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers; | ||
|
||
# Set up password-less sudo for the vagrant user | ||
echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; | ||
chmod 440 /etc/sudoers.d/99_vagrant; |
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,17 @@ | ||
Set-StrictMode -Version Latest | ||
$ProgressPreference = 'SilentlyContinue' | ||
$ErrorActionPreference = 'Stop' | ||
|
||
trap { | ||
Write-Host | ||
Write-Host "ERROR: $_" | ||
($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host | ||
($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host | ||
Write-Host | ||
Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' | ||
Start-Sleep -Seconds (60*60) | ||
Exit 1 | ||
} | ||
|
||
Write-Host 'Enable filesharing' | ||
Enable-NetFirewallRule -DisplayGroup "File and Printer Sharing" |
Oops, something went wrong.