Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
server
virtinstaller
Commits
dd402a2b
Commit
dd402a2b
authored
Mar 26, 2016
by
Steffen Gebert
Browse files
Update virt-install-debian
parent
179b0c31
Changes
1
Hide whitespace changes
Inline
Side-by-side
virt-install-debian
View file @
dd402a2b
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment