From 49daa40014e07fd1a3edf8d6f2e9f3f69bbe0166 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 3 Mar 2014 13:03:11 +0100 Subject: [PATCH 1/1] Add script to install Salt backport into new hosts Signed-off-by: martin f. krafft --- .../late_commands.d/install_salt_backport | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 preseed/wheezy/commands/late_commands.d/install_salt_backport 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 -- 2.39.5