azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
azvyagintsev | dd13784 | 2018-07-13 18:13:06 +0300 | [diff] [blame] | 3 | SALTSTACK_REPO=${SALTSTACK_REPO:-"deb [arch=amd64] https://mirror.mirantis.com/stable/saltstack-2017.7/xenial/ xenial main"} |
| 4 | SALTSTACK_GPG=${SALTSTACK_GPG:-"https://mirror.mirantis.com/proposed/saltstack-2017.7/xenial/SALTSTACK-GPG-KEY.pub"} |
azvyagintsev | c0d1b8a | 2018-03-22 19:05:03 +0200 | [diff] [blame] | 5 | |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 6 | wget -O - ${SALTSTACK_GPG} | sudo apt-key add - |
azvyagintsev | 4b5603e | 2018-09-14 16:33:14 +0300 | [diff] [blame] | 7 | echo "${SALTSTACK_REPO}" > /etc/apt/sources.list.d/mcp_saltstack.list |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 8 | |
azvyagintsev | 4b5603e | 2018-09-14 16:33:14 +0300 | [diff] [blame] | 9 | # 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 |
| 11 | cat <<EOF >> /etc/apt/preferences.d/mcp_saltstack |
| 12 | Package: libsodium18 |
| 13 | Pin: release o=SaltStack |
| 14 | Pin-Priority: 50 |
| 15 | |
| 16 | Package: * |
| 17 | Pin: release o=SaltStack |
| 18 | Pin-Priority: 1100 |
| 19 | EOF |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 20 | |
Marek Celoud | a00d771 | 2017-03-13 15:52:26 +0100 | [diff] [blame] | 21 | apt-get update |
Filip Pytloun | 30a5076 | 2016-01-19 14:50:45 +0100 | [diff] [blame] | 22 | apt-get -y install salt-minion |
Filip Pytloun | 2a9e58f | 2016-03-18 08:34:56 +0100 | [diff] [blame] | 23 | mkdir -m700 -p /etc/salt/pki/minion |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 24 | |
| 25 | cat <<EOF >> /etc/salt/minion.d/minion.conf |
Richard Felkl | 64dae70 | 2018-03-12 09:39:36 +0100 | [diff] [blame] | 26 | max_event_size: 100000000 |
| 27 | acceptance_wait_time_max: 60 |
| 28 | acceptance_wait_time: 10 |
| 29 | random_reauth_delay: 270 |
| 30 | recon_default: 1000 |
| 31 | recon_max: 60000 |
| 32 | recon_randomize: True |
azvyagintsev | 4053eb2 | 2018-03-29 16:21:51 +0300 | [diff] [blame] | 33 | auth_timeout: 60 |
| 34 | EOF |
| 35 | |
| 36 | rm -vf /etc/apt/apt.conf.d/99allow_unauthenticated |
azvyagintsev | 4b5603e | 2018-09-14 16:33:14 +0300 | [diff] [blame] | 37 | rm -vf /etc/apt/sources.list.d/mcp_saltstack.list |
| 38 | rm -vf /etc/apt/preferences.d/mcp_saltstack |