Load CORD ONOS apps from local containers in single-node pod
diff --git a/roles/juju-setup/tasks/main.yml b/roles/juju-setup/tasks/main.yml
index d6a190c..54900c2 100644
--- a/roles/juju-setup/tasks/main.yml
+++ b/roles/juju-setup/tasks/main.yml
@@ -91,6 +91,10 @@
- name: Copy nova-cloud-controller CA certificate to head
command: juju scp {{ juju_services['nova-cloud-controller']['units'].keys()[0] }}:/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt {{ ansible_user_dir }}
+ register: result
+ until: result | success
+ retries: 10
+ delay: 18
- name: Copy cert to system location
become: yes
diff --git a/roles/onos-load-apps/files/config.xml b/roles/onos-load-apps/files/config.xml
new file mode 100644
index 0000000..58aad2a
--- /dev/null
+++ b/roles/onos-load-apps/files/config.xml
@@ -0,0 +1,7 @@
+<app name="org.opencord.config" origin="ON.Lab" version="1.0-SNAPSHOT"
+ category="Configuration" url="http://opencord.org" title="CORD Configuration"
+ featuresRepo="mvn:org.opencord/config/1.0-SNAPSHOT/xml/features"
+ features="cord-config">
+ <description>CORD Configuration</description>
+ <artifact>mvn:org.opencord/config/1.0-SNAPSHOT</artifact>
+</app>
diff --git a/roles/onos-load-apps/files/vtn.xml b/roles/onos-load-apps/files/vtn.xml
new file mode 100644
index 0000000..9b3eae7
--- /dev/null
+++ b/roles/onos-load-apps/files/vtn.xml
@@ -0,0 +1,8 @@
+<app name="org.opencord.vtn" origin="ON.Lab" version="1.0-SNAPSHOT"
+ category="Traffic Steering" url="http://onosproject.org" title="CORD Virtual Tenant Network"
+ featuresRepo="mvn:org.opencord/vtn/1.0-SNAPSHOT/xml/features"
+ features="cord-vtn"
+ apps="org.onosproject.ovsdb-base,org.onosproject.dhcp,org.onosproject.xosclient,org.opencord.config">
+ <description>VTN for CORD</description>
+ <artifact>mvn:org.opencord/vtn/1.0-SNAPSHOT</artifact>
+</app>
diff --git a/roles/onos-load-apps/tasks/main.yml b/roles/onos-load-apps/tasks/main.yml
new file mode 100644
index 0000000..2096bdb
--- /dev/null
+++ b/roles/onos-load-apps/tasks/main.yml
@@ -0,0 +1,13 @@
+---
+# onos-load-apps/tasks/main.yml
+#
+# Install CORD ONOS apps from local containers
+
+- name: Disable loading from Maven repo
+ command: ansible xos-1 -u ubuntu -m lineinfile \
+ -a "dest=~/xos/xos/configurations/{{ xos_configuration }}/make-vtn-external-yaml.sh state=absent regexp='install_dependencies'"
+
+- name: Load the apps using Docker
+ command: ansible xos-1 -u ubuntu -m shell \
+ -a "cd ~/xos/containers/cord-apps; make {{ item }}; docker run xosproject/cord-app-{{ item }}"
+ with_items: cord_apps
diff --git a/roles/onos-load-apps/vars/main.yml b/roles/onos-load-apps/vars/main.yml
new file mode 100644
index 0000000..8bce3aa
--- /dev/null
+++ b/roles/onos-load-apps/vars/main.yml
@@ -0,0 +1,5 @@
+---
+
+cord_apps:
+- config
+- vtn
diff --git a/roles/onos-vm-install/files/Dockerfile.xos-onos b/roles/onos-vm-install/files/Dockerfile.xos-onos
index 48ee1c1..6ac780b 100644
--- a/roles/onos-vm-install/files/Dockerfile.xos-onos
+++ b/roles/onos-vm-install/files/Dockerfile.xos-onos
@@ -1,6 +1,7 @@
# ONOS dockerfile with XOS additions
-FROM xosproject/onos-fork
+#FROM xosproject/onos-fork
+FROM onosproject/onos:1.6
MAINTAINER Zack Williams <zdw@cs.arizona.edu>
# Include SSL certs
diff --git a/roles/simulate-fabric/defaults/main.yml b/roles/simulate-fabric/defaults/main.yml
index b41396d..c52e0c0 100644
--- a/roles/simulate-fabric/defaults/main.yml
+++ b/roles/simulate-fabric/defaults/main.yml
@@ -10,13 +10,11 @@
- veth0
simfabric_links:
- - name: veth
+ - type: veth
+ dev: veth0
+ peer: fabric
mac: "02:42:0a:a8:00:01"
-simfabric_interfaces:
- - veth0
- - veth1
-
# see note in playbook, won't apply until ansible gets module support
simfabric_iptables:
- table: nat
diff --git a/roles/simulate-fabric/files/simulate-fabric-playbook.yml b/roles/simulate-fabric/files/simulate-fabric-playbook.yml
index 6f24f42..55b6587 100644
--- a/roles/simulate-fabric/files/simulate-fabric-playbook.yml
+++ b/roles/simulate-fabric/files/simulate-fabric-playbook.yml
@@ -38,8 +38,8 @@
with_items: "{{ simfabric_bridges }}"
- name: Create ip links
- when: "ansible_{{ item.name }}0 is not defined"
- command: "ip link add address {{ item.mac }} type {{ item.name }}"
+ when: "ansible_{{ item.dev }} is not defined"
+ command: "ip link add dev {{ item.dev }} address {{ item.mac }} type {{ item.type }} peer name {{ item.peer }}"
with_items: "{{ simfabric_links }}"
- name: Run setup again to obtain link info
@@ -48,7 +48,9 @@
- name: Start interfaces
when: "not ansible_{{ item }}.active"
command: "ip link set dev {{ item }} up"
- with_items: "{{ simfabric_interfaces }}"
+ with_items:
+ - "{{ simfabric_links | map(attribute='dev') | list }}"
+ - "{{ simfabric_links | map(attribute='peer') | list }}"
- name: Add interfaces to bridges
when: "not item.1 in ansible_{{ item.0.name }}.interfaces"
diff --git a/roles/simulate-fabric/templates/simulate-fabric-vars.yml.j2 b/roles/simulate-fabric/templates/simulate-fabric-vars.yml.j2
index 599443f..0d183a2 100644
--- a/roles/simulate-fabric/templates/simulate-fabric-vars.yml.j2
+++ b/roles/simulate-fabric/templates/simulate-fabric-vars.yml.j2
@@ -6,9 +6,6 @@
simfabric_links:
{{ simfabric_links | to_nice_yaml }}
-simfabric_interfaces:
-{{ simfabric_interfaces | to_nice_yaml }}
-
simfabric_iptables:
{{ simfabric_iptables | to_nice_yaml }}