Commit dd402a2b authored by Steffen Gebert's avatar Steffen Gebert
Browse files

Update virt-install-debian

parent 179b0c31
......@@ -39,8 +39,6 @@ fi
HOST_NAME=$SERVER_NAME
SCRIPT_PATH=$(dirname $([ -L $0 ] && readlink -f $0 || echo $0))
# create passwd
PASSWORD=$(makepasswd --minchars=10 --maxchars=12)
echo "Generated random password"
......@@ -52,8 +50,6 @@ then
exit 1
fi
# generate ssh-authorized keys so they can be uploaded into the root-account
$SCRIPT_PATH/gatherkeys.sh > $SCRIPT_PATH/authorized_keys
# note on preseeding
# file must be injected in the root/intrd filesysetm
......@@ -80,3 +76,20 @@ virt-install \
--location 'http://mirror.hetzner.de/debian/packages/dists/jessie/main/installer-amd64/' \
--initrd-inject '/usr/local/virtinstaller/preseed.cfg' \
--extra-args "auto=true netcfg/get_hostname=$HOST_NAME netcfg/hostname=$HOST_NAME passwd/root-password=$PASSWORD passwd/root-password-again=$PASSWORD netcfg/get_ipaddress=$NET_IPV4_ADDRESS netcfg/get_netmask=$NET_IPV4_NETMASK netcfg/get_gateway=$NET_IPV4_GATEWAY console=ttyS0,115200n8 serial"
echo "Finished with virt-install."
echo "Doing some aftermath..."
# shutdown
virsh shutdown $SERVER_NAME
# copy ssh-keys of admins into machine
# generate ssh-authorized keys so they can be uploaded into the root-account
SCRIPT_PATH=$(dirname $([ -L $0 ] && readlink -f $0 || echo $0))
$SCRIPT_PATH/gatherkeys.sh > $SCRIPT_PATH/authorized_keys
virt-copy-in -d $SERVER_NAME $SCRIPT_PATH/authorized_keys /root/.ssh/
# start again
virsh start $SERVER_NAME
# set domain to autostart
virsh autostart $SERVER_NAME
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment