3 # Deploy fai configuration to faiserver,
4 # then start a virtual machine to test the config.
7 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
9 ssh root@faiserver
rm -rf /srv
/fai
/config
/\
*
10 scp
-r /a
/bin
/fai
/fai
/config root@faiserver
:/srv
/fai
11 ssh root@faiserver
tee -a /srv
/fai
/config
/class
/DESKTOP.var
<<EOF
12 ROOTPW='$(cat /p/shadow/standard)'
14 scp ~
/.ssh
/id_rsa.pub \
15 root@faiserver
:/srv
/fai
/config
/files
/home
/ian
/.ssh
/authorized_keys
/DESKTOP
16 s scp
-r /q
/root
/luks root@faiserver
:/srv
/fai
/config
/distro-install-common
17 ssh root@faiserver
chmod -R a
+r
/srv
/fai
/config
/distro-install-common
19 s virshrm demohost ||
:
20 # this one doesn't need to be done every time
21 s qemu-img create
-o preallocation
=metadata
-f qcow2 \
22 /var
/lib
/libvirt
/images
/demohost
30G
23 s qemu-img create
-o preallocation
=metadata
-f qcow2 \
24 /var
/lib
/libvirt
/images
/demohostb
30G
25 # osinfo-query os | gr jessie
26 s virt-install
--os-variant debian8
--cpu host -n demohost
--pxe -r 2048 --vcpus 1 --disk path
=/var
/lib
/libvirt
/images
/demohost
-w bridge
=br0
,mac
=52:54:00:9c
:ef
:ad