fix stretch, upgrade from jessie broke
[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
21 # For multi-boot system.
22 # Check that we aren't in a pxe boot environment.
23 # There is probably a better way to do this.
24 # We check the reverse condition in 51-multi-boot,
25 # and set what os we are installing, but don't check it
26 # into git since it changes regularly. Each host needs
27 # to have a class of either STABLE or STRETCH64.
28 #
29 # It's shell looks like this:
30 # if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
31 # case $HOSTNAME in
32 # tp) STABLE ;;
33 # # add more multi-boot hostnames here
34 # esac
35 # fi
36 #
37 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
38 echo "STABLE"
39 fi
40
41 # use a list of classes for our demo machine
42 echo "FAIBASE DEBIAN PARTITION_PROMPT"
43 case $HOSTNAME in
44 x2|frodo|treetowl)
45 echo "NON_FREE"
46 if [[ -e /a/bin/fai/fai-wrapper ]] && isdebian-stable; then
47 echo "STABLE_NON_FREE"
48 fi
49 ;;
50 lj|lj)
51 echo "LINODESTABLE" ;;
52 esac
53
54 if grep ^52:54:00: /sys/class/net/eth0/address &>/dev/null; then
55 # if our eth0 mac is in the kvm range, we are a vm.
56 echo "VM"
57 fi