fixup initial faiserver bootstrap & small bugs
[automated-distro-installer] / fai / config / class / 50-host-classes
1 #!/bin/bash -l
2
3 # assign classes to hosts based on their hostname
4
5 # NOTE:
6 # 51-multi-boot should have something like this
7 # for transient host configs which are not saved in
8 # git (and make it executable):
9
10 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
11 # case $HOSTNAME in
12 # frodo) echo STABLE ;;
13 # esac
14 # fi
15
16
17 # do not use this if a menu will be presented
18 [ "$flag_menu" ] && exit 0
19
20 # use a list of classes for our demo machine
21 echo "FAIBASE DEBIAN"
22 case $HOSTNAME in
23 demohost)
24 echo "DESKTOP" ;;
25 tp)
26 echo "DESKTOP PARTITION_PROMPT"
27 # For multi-boot system.
28 # Check that we aren't in a pxe boot environment.
29 # There is probably a better way to do this.
30 # We check the reverse condition in 51-multi-boot,
31 # and set what os we are installing, but don't check it
32 # into git since it changes regularly.
33 # It's shell looks like this:
34 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
35 # case $HOSTNAME in
36 # tp) : ;;
37 # # add more multi-boot hostnames here
38 # esac
39 # fi
40 #
41 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
42 echo "STABLE"
43 fi
44 ;;
45 x2|frodo|treetowl)
46 echo "NON_FREE"
47 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
48 echo "STABLE STABLE_NON_FREE"
49 fi
50 ;;
51 lj)
52 echo "LINODESTABLE PARTITION_PROMPT" ;;
53 li)
54 echo "LINODESTABLE PARTITION_PROMPT" ;;
55 do)
56 echo "STABLE PARTITION_PROMPT" ;;
57 # faiserver)
58 # echo "DEMO FAISERVER" ;;
59 # xfcehost)
60 # echo "DEMO XORG XFCE LVM";;
61 # gnomehost)
62 # echo "DEMO XORG GNOME";;
63 # centos)
64 # echo "FAIBASE CENTOS" # you may want to add class XORG here
65 # ifclass I386 && echo CENTOS6_32 # AFAIK there's no 32bit C7
66 # ifclass AMD64 && echo CENTOS7_64
67 # exit 0 ;; # CentOS does not use the GRUB class
68 # slchost)
69 # # Scientific Linux Cern, is very similar to CentOS. SLC should alsways use the class CENTOS
70 # echo "FAIBASE CENTOS SLC" # you may want to add class XORG here
71 # ifclass I386 && echo SLC7_32
72 # ifclass AMD64 && echo SLC7_64
73 # exit 0 ;; # CentOS/SLC does not use the GRUB class
74 *)
75 echo "DESKTOP" ;;
76 esac
77
78 if grep ^52:54:00: /sys/class/net/eth0/address &>/dev/null; then
79 # if our eth0 mac is in the kvm range, we are a vm.
80 echo "VM"
81 fi