From: martin f. krafft Date: Mon, 3 Mar 2014 12:03:11 +0000 (+0100) Subject: Add script to install Salt backport into new hosts X-Git-Url: https://git.madduck.net/code/vinst.git/commitdiff_plain/49daa40014e07fd1a3edf8d6f2e9f3f69bbe0166?ds=sidebyside;hp=e9bfd20022f3d770c68234259b56445d7dcba773 Add script to install Salt backport into new hosts Signed-off-by: martin f. krafft --- diff --git a/preseed/wheezy/commands/late_commands.d/install_salt_backport b/preseed/wheezy/commands/late_commands.d/install_salt_backport new file mode 100755 index 0000000..050d23c --- /dev/null +++ b/preseed/wheezy/commands/late_commands.d/install_salt_backport @@ -0,0 +1,34 @@ +#!/bin/sh + +TMPLIST=/etc/apt/sources.list.d/tmp-backports.list + +echo "Temporarily enabling backports" +sed -ne 's/-updates/-backports/p' /etc/apt/sources.list > $TMPLIST + +SUITE=$(tail -1 $TMPLIST | cut -d' ' -f3) +SUITE=${SUITE%-*} + +cat <<_eof >> $TMPLIST +deb http://debian.saltstack.com/debian ${SUITE}-saltstack main +_eof + +cd /tmp +wget -O salt.gpg http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key +echo "145157dfb896f7a0c1f390c6f72e6d092fbbfaf4374b510d4c7828c4177ab476 salt.gpg" | sha256sum -c || exit 1 +apt-key --keyring /etc/apt/trusted.gpg.d/salt.gpg add salt.gpg && rm salt.gpg + +apt-get update + +rm -f /etc/apt/trusted.gpg.d/salt.gpg + +TMPCONF=/etc/default/salt-minion + +echo "exit 0" > $TMPCONF + +echo "Installing Salt minion (possibly from $SUITE-backports and $SUITE-saltstack)" +export DEBCONF_FRONTEND=noninteractive +apt-get install --no-install-recommends -t $SUITE-saltstack -y salt-minion + +echo "pki_dir: /var/lib/salt/minion/pki" > /etc/salt/minion.d/tmp-pki-in-varlib.conf + +rm -f $TMPLIST $TMPCONF