manifest 1.6 KB
Newer Older
sparrowhawk's avatar
sparrowhawk committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#!/bin/sh -e
#
# 2021 Joachim Desroches (joachim.desroches@epfl.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#


os=$(cat "${__global:?}/explorer/os")

case "$os" in
'alpine')
26
	packages="jool-tools jool-tools-openrc $(cat "${__object:?}"/explorer/alpine-kernel-modules)"
sparrowhawk's avatar
sparrowhawk committed
27 28 29 30 31 32 33
	;;
*)
	printf "This type has no implementation for %s. Please contribute one if you can.\n" "$os"
	exit 1
	;;
esac

34
for pkg in $packages;
sparrowhawk's avatar
sparrowhawk committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
do
	__package "$pkg"
done

instance="default"
if [ -f "${__object:?}/parameter/instance" ];
then
	instance="$(cat "${__object:?}/parameter/instance")"
fi

framework="netfilter"
if [ -f "${__object:?}/parameter/framework" ];
then
	framework="$(cat "${__object:?}/parameter/framework")"
fi

pool6="64:ff9b::/96"
if [ -f "${__object:?}/parameter/pool6" ];
then
	pool6="$(cat "${__object:?}/parameter/pool6")"
fi

require='__package/jool-tools' __file /etc/jool/jool.conf \
	--source - <<- EOF
	{
	  "instance": "$instance",
	  "framework": "$framework",
	  "global": {
	    "pool6": "$pool6"
	  }
	}
	EOF

__start_on_boot 'jool'