77f71b9f59
Ansible will exec a script in the OVS container to ensure the bridge and ports are properly setup. The script is idempotent. Change-Id: I5adca595a4d2ef4edf26c9635cfa5ceb30ca4a59 Closes-Bug: #1466375
18 lines
291 B
Bash
Executable File
18 lines
291 B
Bash
Executable File
#!/bin/bash
|
|
|
|
bridge=$1
|
|
port=$2
|
|
|
|
ovs-vsctl br-exists $bridge; rc=$?
|
|
if [[ $rc == 2 ]]; then
|
|
changed=changed
|
|
ovs-vsctl add-br $bridge
|
|
fi
|
|
|
|
if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
|
|
changed=changed
|
|
ovs-vsctl add-port $bridge $port
|
|
fi
|
|
|
|
echo $changed
|