blob: 515c3c44f16b56809237d84fa364926b9d7e7514 [file] [log] [blame]
---
# onos-load-apps/tasks/main.yml
- name: Disable loading of CORD apps from Maven repo
command: ansible xos-1 -u ubuntu -m lineinfile \
-a "dest=~/service-profile/{{ xos_configuration }}/make-vtn-external-yaml.sh state=absent regexp='install_dependencies'"
tags:
- skip_ansible_lint # running a sub-job
- name: Create directory for CORD apps and load script
file:
state: directory
dest: "{{ ansible_user_dir }}/cord_apps/"
- name: Create cord_app_loader.sh script to load CORD apps
template:
src: "{{ item }}.j2"
dest: "{{ ansible_user_dir }}/cord_apps/{{ item }}"
mode: 0755
with_items:
- cord_app_loader.sh
- name: Copy onos-app REST API app loader tool
copy:
src: "{{ item }}"
dest: "{{ ansible_user_dir }}/cord_apps/{{ item }}"
mode: 0755
with_items:
- onos-app
- name: Wait for ONOS to be ready
wait_for:
host: "{{ onos_cord_vm_hostname }}"
port: 8181
- name: Download CORD apps from maven repo
maven_artifact:
repository_url: "{{ cord_apps_repo_url }}"
group_id: "org.opencord"
artifact_id: "{{ item.name }}"
version: "{{ cord_apps_version }}"
extension: "oar"
dest: "{{ ansible_user_dir }}/cord_apps/{{ item.name }}.oar"
with_items: "{{ cord_apps }}"
register: maven_artifact_dl
# assumes no interruption between this and previous steps...
- name: Install CORD apps
when: maven_artifact_dl.changed
command: "{{ ansible_user_dir }}/cord_apps/cord_app_loader.sh"