blob: b1a138922262ec9591099a6a3c6e9022a8315cf4 [file] [log] [blame]
azvyagintsevc0d1b8a2018-03-22 19:05:03 +02001#!/bin/bash -xe
2
azvyagintsevdd137842018-07-13 18:13:06 +03003SALTSTACK_REPO=${SALTSTACK_REPO:-"deb [arch=amd64] https://mirror.mirantis.com/stable/saltstack-2017.7/xenial/ xenial main"}
4SALTSTACK_GPG=${SALTSTACK_GPG:-"https://mirror.mirantis.com/proposed/saltstack-2017.7/xenial/SALTSTACK-GPG-KEY.pub"}
azvyagintsevc0d1b8a2018-03-22 19:05:03 +02005
azvyagintsev4053eb22018-03-29 16:21:51 +03006wget -O - ${SALTSTACK_GPG} | sudo apt-key add -
azvyagintsev4b5603e2018-09-14 16:33:14 +03007echo "${SALTSTACK_REPO}" > /etc/apt/sources.list.d/mcp_saltstack.list
azvyagintsev4053eb22018-03-29 16:21:51 +03008
azvyagintsev4b5603e2018-09-14 16:33:14 +03009# This Pin-Priority fil should be always aligned with
10# https://github.com/Mirantis/reclass-system-salt-model/blob/master/linux/system/repo/mcp/apt_mirantis/saltstack.yml
11cat <<EOF >> /etc/apt/preferences.d/mcp_saltstack
12Package: libsodium18
13Pin: release o=SaltStack
14Pin-Priority: 50
15
16Package: *
17Pin: release o=SaltStack
18Pin-Priority: 1100
19EOF
azvyagintsev4053eb22018-03-29 16:21:51 +030020
Marek Celouda00d7712017-03-13 15:52:26 +010021apt-get update
Filip Pytloun30a50762016-01-19 14:50:45 +010022apt-get -y install salt-minion
Filip Pytloun2a9e58f2016-03-18 08:34:56 +010023mkdir -m700 -p /etc/salt/pki/minion
azvyagintsev4053eb22018-03-29 16:21:51 +030024
25cat <<EOF >> /etc/salt/minion.d/minion.conf
Richard Felkl64dae702018-03-12 09:39:36 +010026max_event_size: 100000000
27acceptance_wait_time_max: 60
28acceptance_wait_time: 10
29random_reauth_delay: 270
30recon_default: 1000
31recon_max: 60000
32recon_randomize: True
azvyagintsev4053eb22018-03-29 16:21:51 +030033auth_timeout: 60
34EOF
35
36rm -vf /etc/apt/apt.conf.d/99allow_unauthenticated
azvyagintsev4b5603e2018-09-14 16:33:14 +030037rm -vf /etc/apt/sources.list.d/mcp_saltstack.list
38rm -vf /etc/apt/preferences.d/mcp_saltstack