Richard Felkl | 4c4829d | 2017-11-11 00:12:20 +0100 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
| 3 | export SALT_MASTER_DEPLOY_IP=10.1.0.14 |
| 4 | export APTLY_DEPLOY_IP=10.1.0.14 |
| 5 | export APTLY_DEPLOY_NETMASK=255.255.0.0 |
| 6 | export APTLY_MINION_ID=apt01.deploy-name.local |
| 7 | |
| 8 | echo "Configuring network interfaces" |
Dmitry Stremkouski | f50ea26 | 2017-12-05 19:35:40 +0300 | [diff] [blame] | 9 | find /etc/network/interfaces.d/ -type f -delete |
| 10 | kill $(pidof /sbin/dhclient) || /bin/true |
Richard Felkl | 4c4829d | 2017-11-11 00:12:20 +0100 | [diff] [blame] | 11 | envsubst < /root/interfaces > /etc/network/interfaces |
Dmitry Stremkouski | a94b5f3 | 2017-12-02 00:41:54 +0300 | [diff] [blame] | 12 | ip a flush dev ens3 |
Dmitry Stremkouski | b43c4ee | 2017-12-02 02:21:05 +0300 | [diff] [blame] | 13 | rm -f /var/run/network/ifstate.ens3 |
| 14 | if [[ $(grep -E '^\ *gateway\ ' /etc/network/interfaces) ]]; then |
| 15 | (ip r s | grep ^default) && ip r d default || /bin/true |
| 16 | fi; |
Dmitry Stremkouski | a94b5f3 | 2017-12-02 00:41:54 +0300 | [diff] [blame] | 17 | ifup ens3 |
Richard Felkl | 4c4829d | 2017-11-11 00:12:20 +0100 | [diff] [blame] | 18 | |
| 19 | echo "Configuring salt" |
| 20 | service salt-minion stop |
| 21 | systemctl disable salt-minion.service |
| 22 | envsubst < /root/minion.conf > /etc/salt/minion.d/minion.conf |
| 23 | #service salt-minion restart |