Detect name of bridge that corresponds to fabric
Change-Id: I7b4bd73ecac82a971a77b5a12213f781bd3405a1
diff --git a/roles/test-vsg/defaults/main.yml b/roles/test-vsg/defaults/main.yml
deleted file mode 100644
index 45c23ec..0000000
--- a/roles/test-vsg/defaults/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-
-fabric_bridge_on_head_node: "virbr3"
-
diff --git a/roles/test-vsg/tasks/main.yml b/roles/test-vsg/tasks/main.yml
index 308a731..4685010 100644
--- a/roles/test-vsg/tasks/main.yml
+++ b/roles/test-vsg/tasks/main.yml
@@ -54,13 +54,19 @@
tags:
- skip_ansible_lint # running a sub job
+- name: get "fabric" bridge interface
+ shell: route -n | grep 10.6.1.0 | awk '{print $8}'
+ register: bridge
+ tags:
+ - skip_ansible_lint # running a sub job
+
# Specifying this through container_config below was not working...
- name: set lxc bridge interface
become: yes
lineinfile:
dest: /etc/lxc/default.conf
regexp: "^lxc.network.link ="
- line: "lxc.network.link = {{ fabric_bridge_on_head_node }}"
+ line: "lxc.network.link = {{ bridge.stdout }}"
- name: Create testclient
become: yes