Skip to content

Commit

Permalink
Merge pull request #105 from orlikoski/esxi_packer
Browse files Browse the repository at this point in the history
Skadi 2019.2 Update
  • Loading branch information
epicsilence99 authored Mar 27, 2019
2 parents 1d03e24 + d00f959 commit 2090b27
Show file tree
Hide file tree
Showing 23 changed files with 200 additions and 619 deletions.
4 changes: 2 additions & 2 deletions Docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.4'
services:
timesketch:
image: aorlikoski/skadi_timesketch:1.4
image: aorlikoski/skadi_timesketch:20190326
container_name: timesketch
ports:
- 127.0.0.1:5000:5000
Expand Down Expand Up @@ -115,7 +115,7 @@ services:
restart: always

cyberchef:
image: aorlikoski/skadi_cyberchef:latest
image: aorlikoski/skadi_cyberchef:20190326
container_name: cyberchef
ports:
- 127.0.0.1:8000:8000
Expand Down
81 changes: 0 additions & 81 deletions Packer/GCP/skadi_server.json

This file was deleted.

43 changes: 0 additions & 43 deletions Packer/VirtualBox/http/preseed.cfg

This file was deleted.

129 changes: 0 additions & 129 deletions Packer/VirtualBox/skadi_server.json

This file was deleted.

1 change: 0 additions & 1 deletion Packer/auth_files/template_creds.json

This file was deleted.

3 changes: 1 addition & 2 deletions Packer/script/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ apt-get -y autoremove --purge
apt-get -y clean
apt-get -y autoclean


# Remove Bash history
unset HISTFILE
rm -f /root/.bash_history
rm -f /home/${SSH_USER}/.bash_history
rm -f /home/$SKADI_USER/.bash_history
rm -f /home/$SKADI_USER/.bash_history

# Clean up log files
Expand Down
17 changes: 17 additions & 0 deletions Packer/script/skadi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

date > /etc/box_build_time

SSH_USER=$skadi
SSH_PASS=$skadi
SSH_USER_HOME=$/home/$SSH_USER

# Set up sudo
echo "==> Giving $SSH_USER sudo powers"
echo "$SSH_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/$SSH_USER
chmod 440 /etc/sudoers.d/$SSH_USER

# Fix stdin not being a tty
if grep -q -E "^mesg n$" /root/.profile && sed -i "s/^mesg n$/tty -s \\&\\& mesg n/g" /root/.profile; then
echo "==> Fixed stdin not being a tty."
fi
12 changes: 8 additions & 4 deletions Packer/script/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
echo "==> Disabling the release upgrader"
sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades

# Sync Date
sudo timedatectl set-ntp off
sudo timedatectl set-ntp on

echo "==> Checking version of Ubuntu"
. /etc/lsb-release

if [[ $DISTRIB_RELEASE == 16.04 || $DISTRIB_RELEASE == 16.10 ]]; then
echo "==> Disabling periodic apt upgrades"
echo 'APT::Periodic::Enable "0";' >> /etc/apt/apt.conf.d/10periodic
fi

echo "==> Disabling periodic apt upgrades"
echo 'APT::Periodic::Enable "0";' >> /etc/apt/apt.conf.d/10periodic



echo "==> Updating list of repositories"
Expand Down
17 changes: 10 additions & 7 deletions Packer/script/vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@

date > /etc/box_build_time

SSH_USER=${SSH_USERNAME:-vagrant}
SSH_PASS=${SSH_PASSWORD:-vagrant}
SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}}
SSH_USER=vagrant
SSH_PASS=vagrant
SSH_USER_HOME=/home/$SSH_USER
VAGRANT_INSECURE_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"


if ! id -u $SSH_USER >/dev/null 2>&1; then
echo "==> Creating $SSH_USER user"
/usr/sbin/groupadd $SSH_USER
/usr/sbin/useradd $SSH_USER -g $SSH_USER -G sudo -d $SSH_USER_HOME --create-home
echo "${SSH_USER}:${SSH_PASS}" | chpasswd
echo "$SSH_USER:$SSH_PASS" | chpasswd
fi

# Set up sudo
echo "==> Giving ${SSH_USER} sudo powers"
echo "${SSH_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/$SSH_USER
echo "==> Giving $SSH_USER sudo powers"
echo "$SSH_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/$SSH_USER
chmod 440 /etc/sudoers.d/$SSH_USER

# Add vagrant user to the docker usergroup
sudo usermod -aG docker $SSH_USER

# Fix stdin not being a tty
if grep -q -E "^mesg n$" /root/.profile && sed -i "s/^mesg n$/tty -s \\&\\& mesg n/g" /root/.profile; then
echo "==> Fixed stdin not being a tty."
Expand All @@ -31,6 +34,6 @@ chmod 700 $SSH_USER_HOME/.ssh
cd $SSH_USER_HOME/.ssh

# https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub
echo "${VAGRANT_INSECURE_KEY}" > $SSH_USER_HOME/.ssh/authorized_keys
echo "$VAGRANT_INSECURE_KEY" > $SSH_USER_HOME/.ssh/authorized_keys
chmod 600 $SSH_USER_HOME/.ssh/authorized_keys
chown -R $SSH_USER:$SSH_USER $SSH_USER_HOME/.ssh
10 changes: 5 additions & 5 deletions Packer/script/virtualbox.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -eux

SSH_USER=${SSH_USERNAME:-vagrant}
SSH_USER=skadi
#SSH_USER="root"


Expand All @@ -9,9 +9,9 @@ echo "==> Installing VirtualBox guest additions"
#apt-get install -y linux-headers-$(uname -r) build-essential perl
#apt-get install -y dkms

VBOX_VERSION=$(cat /home/${SSH_USER}/.vbox_version)
mount -o loop /home/${SSH_USER}/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
VBOX_VERSION=$(cat /home/$SSH_USER/.vbox_version)
mount -o loop /home/$SSH_USER/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm /home/${SSH_USER}/VBoxGuestAdditions_$VBOX_VERSION.iso
rm /home/${SSH_USER}/.vbox_version
rm /home/$SSH_USER/VBoxGuestAdditions_$VBOX_VERSION.iso
rm /home/$SSH_USER/.vbox_version
4 changes: 4 additions & 0 deletions Packer/skadi_build/build_skadi.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packer build -force create_basebox.json
packer build -force create_boxes.json
vagrant.exe box add box/virtualbox/skadi_server-2019.2.box --name skadivm/skadi_server
vagrant.exe box add box/vmware/skadi_server-2019.2.box --name skadivm/skadi_server
Loading

0 comments on commit 2090b27

Please sign in to comment.