Vagrant-Ansible scripts for tutorial vm
Change-Id: I0481fa9c7df897812a765973440b6b1b2bf669f8
diff --git a/tools/dev/vagrant/ansible/roles/brctl/templates/add_iface.j2 b/tools/dev/vagrant/ansible/roles/brctl/templates/add_iface.j2
index f09bd50..b391252 100644
--- a/tools/dev/vagrant/ansible/roles/brctl/templates/add_iface.j2
+++ b/tools/dev/vagrant/ansible/roles/brctl/templates/add_iface.j2
@@ -6,12 +6,12 @@
fi
CHANGED='false'
-FOUND=$(brctl show | grep "^{{ interfaces.hostonly }}" | wc -l)
+FOUND=$(brctl show | grep "^{{ bridge.phy_interface }}" | wc -l)
if [ $FOUND -eq 0 ]; then
CHANGED='true'
- brctl addif {{ networks.bridge_name }} {{ interfaces.hostonly }}
+ brctl addif {{ bridge.name }} {{ bridge.phy_interface }}
fi
if [ $REPORT_CHANGED -ne 0 ]; then
echo -n $CHANGED
-fi
+fi
\ No newline at end of file
diff --git a/tools/dev/vagrant/ansible/roles/brctl/templates/create_bridge.j2 b/tools/dev/vagrant/ansible/roles/brctl/templates/create_bridge.j2
index 5f12261..c301d11 100644
--- a/tools/dev/vagrant/ansible/roles/brctl/templates/create_bridge.j2
+++ b/tools/dev/vagrant/ansible/roles/brctl/templates/create_bridge.j2
@@ -6,12 +6,12 @@
fi
CHANGED='false'
-FOUND=$(brctl show | grep "^{{ networks.bridge_name }}" | wc -l)
+FOUND=$(brctl show | grep "^{{ bridge.name }}" | wc -l)
if [ $FOUND -eq 0 ]; then
CHANGED='true'
- brctl addbr {{ networks.bridge_name }}
+ brctl addbr {{ bridge.name }}
fi
if [ $REPORT_CHANGED -ne 0 ]; then
echo -n $CHANGED
-fi
+fi
\ No newline at end of file
diff --git a/tools/dev/vagrant/ansible/roles/brctl/templates/post_ifup.j2 b/tools/dev/vagrant/ansible/roles/brctl/templates/post_ifup.j2
new file mode 100644
index 0000000..4156a2e
--- /dev/null
+++ b/tools/dev/vagrant/ansible/roles/brctl/templates/post_ifup.j2
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+ip addr flush {{ bridge.phy_interface }}
+ifconfig {{ bridge.name }} inet {{ bridge.ip }}
+ifconfig {{ bridge.name }} up
\ No newline at end of file