blob: aa2825b8d7fdecf2d7d2c672214d10bdfd0fa916 [file] [log] [blame]
Richard Felkl4c4829d2017-11-11 00:12:20 +01001#!/bin/bash -xe
2
3export SALT_MASTER_DEPLOY_IP=10.1.0.14
4export APTLY_DEPLOY_IP=10.1.0.14
5export APTLY_DEPLOY_NETMASK=255.255.0.0
6export APTLY_MINION_ID=apt01.deploy-name.local
7
8echo "Configuring network interfaces"
Dmitry Stremkouskif50ea262017-12-05 19:35:40 +03009find /etc/network/interfaces.d/ -type f -delete
10kill $(pidof /sbin/dhclient) || /bin/true
Richard Felkl4c4829d2017-11-11 00:12:20 +010011envsubst < /root/interfaces > /etc/network/interfaces
Dmitry Stremkouskia94b5f32017-12-02 00:41:54 +030012ip a flush dev ens3
Dmitry Stremkouskib43c4ee2017-12-02 02:21:05 +030013rm -f /var/run/network/ifstate.ens3
14if [[ $(grep -E '^\ *gateway\ ' /etc/network/interfaces) ]]; then
15(ip r s | grep ^default) && ip r d default || /bin/true
16fi;
Dmitry Stremkouskia94b5f32017-12-02 00:41:54 +030017ifup ens3
Richard Felkl4c4829d2017-11-11 00:12:20 +010018
19echo "Configuring salt"
20service salt-minion stop
21systemctl disable salt-minion.service
22envsubst < /root/minion.conf > /etc/salt/minion.d/minion.conf
23#service salt-minion restart