CORD-3172 Fix vspgwc for 6.0
Change-Id: I364b25a932b35e4c4e679dd2541e3dc4b2c7cac0
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index 3157aa4..08bd6ef 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -15,6 +15,10 @@
# xosproject/vspgwc-synchronizer
FROM xosproject/xos-synchronizer-base:candidate
+RUN apt-get update && apt-get install -y \
+ net-tools \
+ && rm -rf /var/lib/apt/lists/*
+
COPY xos/synchronizer /opt/xos/synchronizers/vspgwc
COPY VERSION /opt/xos/synchronizers/vspgwc/
diff --git a/xos/synchronizer/steps/roles/onos_rule_setup/tasks/main.yml b/xos/synchronizer/steps/roles/onos_rule_setup/tasks/main.yml
index 567231f..868f92c 100644
--- a/xos/synchronizer/steps/roles/onos_rule_setup/tasks/main.yml
+++ b/xos/synchronizer/steps/roles/onos_rule_setup/tasks/main.yml
@@ -19,10 +19,6 @@
src=onos_rule_setup_info.sh.j2
dest=/opt/xos/synchronizers/vspgwc/onos_rule_setup_info.sh owner=root group=root mode=755
-- name: get onos ip address
- shell: /opt/xos/synchronizers/vspgwc/onos_rule_setup_info.sh -i onos
- register: tmp_onos_ip
-
- name: get application server (Internet) port for SGi
shell: /opt/xos/synchronizers/vspgwc/onos_rule_setup_info.sh -p enb
register: tmp_as_sgi_port
@@ -49,7 +45,6 @@
- name: assign results into each variable
set_fact:
- onos_ip: "{{ tmp_onos_ip.stdout }}"
as_sgi_port: "{{ tmp_as_sgi_port.stdout }}"
spgwu_sgi_port: "{{ tmp_spgwu_sgi_port.stdout }}"
enb_sw_id: "{{ tmp_enb_sw_id.stdout }}"
@@ -68,7 +63,7 @@
dest=/opt/xos/synchronizers/vspgwc/flow_spgwu.json owner=root group=root mode=755
- name: set flow for enb and spgwu to ONOS
- shell: "curl -X POST -H \"Content-Type: application/json\" -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_enb.json http://{{ onos_ip }}:8182/onos/v1/flows/{{ enb_sw_id }} ; curl -X POST -H \"Content-Type: application/json\" -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_spgwu.json http://{{ onos_ip }}:8182/onos/v1/flows/{{ spgwu_sw_id }}"
+ shell: "curl -X POST -H \"Content-Type: application/json\" -s -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_enb.json http://onos-cord-ui:8181/onos/v1/flows/{{ enb_sw_id }} ; curl -X POST -H \"Content-Type: application/json\" -s -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_spgwu.json http://onos-cord-ui:8181/onos/v1/flows/{{ spgwu_sw_id }}"
- name: make json file for flow of enb to tunnel
when: enb_sw_ip != spgwu_sw_ip
@@ -84,4 +79,4 @@
- name: set flow for enb and spgwu through tunnel to ONOS
when: enb_sw_ip != spgwu_sw_ip
- shell: "curl -X POST -H \"Content-Type: application/json\" -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_enb_tnl.json http://{{ onos_ip }}:8182/onos/v1/flows/{{ spgwu_sw_id }} ; curl -X POST -H \"Content-Type: application/json\" -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_spgwu_tnl.json http://{{ onos_ip }}:8182/onos/v1/flows/{{ enb_sw_id }}"
+ shell: "curl -X POST -H \"Content-Type: application/json\" -s -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_enb_tnl.json http://onos-cord-ui:8181/onos/v1/flows/{{ spgwu_sw_id }} ; curl -X POST -H \"Content-Type: application/json\" -s -u onos:rocks -d @/opt/xos/synchronizers/vspgwc/flow_spgwu_tnl.json http://onos-cord-ui:8181/onos/v1/flows/{{ enb_sw_id }}"
diff --git a/xos/synchronizer/steps/roles/onos_rule_setup/templates/onos_rule_setup_info.sh.j2 b/xos/synchronizer/steps/roles/onos_rule_setup/templates/onos_rule_setup_info.sh.j2
index 018c387..c560192 100644
--- a/xos/synchronizer/steps/roles/onos_rule_setup/templates/onos_rule_setup_info.sh.j2
+++ b/xos/synchronizer/steps/roles/onos_rule_setup/templates/onos_rule_setup_info.sh.j2
@@ -24,17 +24,13 @@
ONOS_ID="karaf"
ONOS_PW="karaf"
-# To get IP address for Head Node (to access ONOS-VTN/fabric)
-function get_head_node {
- netstat -nr | awk '{if ($1 == "0.0.0.0") print $2}'
-}
function get_hosts {
- echo $(curl $(get_head_node)/vtn/onos/v1/hosts -u $ONOS_ID:$ONOS_PW)
+ echo $(curl http://onos-cord-ui:8181/onos/v1/hosts -s -u $ONOS_ID:$ONOS_PW)
}
function get_hosts_fabric {
- echo $(curl $(get_head_node):8181/onos/v1/hosts -u $ONOS_ID:$ONOS_PW)
+ echo $(curl http://onos-fabric-ui:8181/onos/v1/hosts -s -u $ONOS_ID:$ONOS_PW)
}
function get_host {
@@ -180,9 +176,6 @@
elif [ "$OPTION" == "spgwu" ]; then
echo $SGI_SPGWU > spgwu_ip
cat spgwu_ip
- elif [ "$OPTION" == "onos" ]; then
- get_head_node > onos_ip
- cat onos_ip
else
echo "Wrong argument"
print_help_ip