2017-06-09 23:25:56 +00:00
|
|
|
#!/bin/bash
|
2017-10-30 17:57:55 +00:00
|
|
|
# running from a git repo
|
|
|
|
# ansible files exist
|
2017-10-24 16:39:49 +00:00
|
|
|
CWD=`pwd`
|
2017-10-30 17:57:55 +00:00
|
|
|
export ANSIBLE_LOG_PATH="$CWD/iiab-network.log"
|
2017-10-24 16:39:49 +00:00
|
|
|
|
2017-12-05 15:33:35 +00:00
|
|
|
if [ ! -f iiab-network.yml ]; then
|
|
|
|
echo "IIAB Playbook not found."
|
|
|
|
echo "Please run this command from the top level of the git repo."
|
|
|
|
echo "Exiting."
|
|
|
|
exit 1
|
2017-06-09 23:25:56 +00:00
|
|
|
fi
|
|
|
|
|
2017-12-05 15:33:35 +00:00
|
|
|
if [ ! -f /etc/iiab/config_vars.yml ]; then
|
|
|
|
mkdir -p /etc/iiab
|
|
|
|
echo "{}" > /etc/iiab/config_vars.yml
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f /etc/iiab/iiab.env ]; then
|
|
|
|
source /etc/iiab/iiab.env
|
|
|
|
else
|
|
|
|
OS="unknown"
|
2017-06-09 23:25:56 +00:00
|
|
|
fi
|
|
|
|
|
2017-09-13 11:07:25 +00:00
|
|
|
Start=`date`
|
2017-06-09 23:25:56 +00:00
|
|
|
ansible-playbook -i ansible_hosts iiab-network.yml --connection=local
|
2017-09-15 16:56:57 +00:00
|
|
|
End=`date`
|
2017-06-09 23:25:56 +00:00
|
|
|
echo "" >> iiab-network.log
|
2017-12-05 15:33:35 +00:00
|
|
|
# redhat path
|
|
|
|
if [ ! "OS" == "debian" ] && [ ! "OS" == "unknown" ]; then
|
2017-09-15 16:56:57 +00:00
|
|
|
ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log
|
2017-12-05 15:33:35 +00:00
|
|
|
fi
|
|
|
|
# ubuntu destop might be using NM - split out.
|
|
|
|
if [ $(which nmcli) ]; then
|
2017-06-09 23:25:56 +00:00
|
|
|
nmcli d >> iiab-network.log
|
|
|
|
nmcli c >> iiab-network.log
|
|
|
|
fi
|
2017-09-13 11:07:25 +00:00
|
|
|
echo "" >> iiab-network.log
|
2017-09-15 16:56:57 +00:00
|
|
|
ip r >> iiab-network.log
|
2017-09-13 11:07:25 +00:00
|
|
|
echo "" >> iiab-network.log
|
2017-09-15 16:56:57 +00:00
|
|
|
brctl show br0>> iiab-network.log
|
|
|
|
echo "run start: $Start" >> iiab-network.log
|
|
|
|
echo "run end: $End" >> iiab-network.log
|
2017-06-09 23:25:56 +00:00
|
|
|
echo "" >> iiab-network.log
|
|
|
|
echo "" >> iiab-network.log
|
2017-09-15 16:56:57 +00:00
|
|
|
ip r
|
|
|
|
brctl show br0
|
|
|
|
echo "run start:$Start"
|
|
|
|
echo "run end: $End"
|