azvyagintsev | 9a1737f | 2019-03-11 15:44:54 +0200 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
| 3 | SALTSTACK_REPO=${SALTSTACK_REPO:-"deb [arch=amd64] https://mirror.mirantis.com/proposed/saltstack-2017.7/bionic/ bionic main"} |
| 4 | SALTSTACK_GPG=${SALTSTACK_GPG:-"https://mirror.mirantis.com/proposed/saltstack-2017.7/bionic/SALTSTACK-GPG-KEY.pub"} |
| 5 | |
| 6 | wget -O - ${SALTSTACK_GPG} | sudo apt-key add - |
| 7 | echo "${SALTSTACK_REPO}" > /etc/apt/sources.list.d/mcp_saltstack.list |
| 8 | |
| 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: * |
| 13 | Pin: release o=SaltStack |
| 14 | Pin-Priority: 1100 |
| 15 | EOF |
| 16 | |
| 17 | apt-get update |
| 18 | apt-get -y install salt-minion |
| 19 | mkdir -m700 -p /etc/salt/pki/minion |
| 20 | |
| 21 | cat <<EOF >> /etc/salt/minion.d/minion.conf |
| 22 | max_event_size: 100000000 |
| 23 | acceptance_wait_time_max: 60 |
| 24 | acceptance_wait_time: 10 |
| 25 | random_reauth_delay: 270 |
| 26 | recon_default: 1000 |
| 27 | recon_max: 60000 |
| 28 | recon_randomize: True |
| 29 | auth_timeout: 60 |
| 30 | EOF |
| 31 | |
| 32 | rm -vf /etc/apt/apt.conf.d/99allow_unauthenticated |
| 33 | rm -vf /etc/apt/sources.list.d/mcp_saltstack.list |
| 34 | rm -vf /etc/apt/preferences.d/mcp_saltstack |