Andy Bavier | c233512 | 2016-06-25 09:59:22 -0400 | [diff] [blame] | 1 | --- |
| 2 | # onos-load-apps/tasks/main.yml |
Andy Bavier | c233512 | 2016-06-25 09:59:22 -0400 | [diff] [blame] | 3 | |
Zack Williams | 2b94629 | 2016-08-22 15:32:29 -0700 | [diff] [blame] | 4 | - name: Disable loading of CORD apps from Maven repo |
Andy Bavier | c233512 | 2016-06-25 09:59:22 -0400 | [diff] [blame] | 5 | command: ansible xos-1 -u ubuntu -m lineinfile \ |
Scott Baker | 333a315 | 2016-06-29 08:58:42 -0700 | [diff] [blame] | 6 | -a "dest=~/service-profile/{{ xos_configuration }}/make-vtn-external-yaml.sh state=absent regexp='install_dependencies'" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 7 | tags: |
| 8 | - skip_ansible_lint # running a sub-job |
Andy Bavier | c233512 | 2016-06-25 09:59:22 -0400 | [diff] [blame] | 9 | |
Zack Williams | 2b94629 | 2016-08-22 15:32:29 -0700 | [diff] [blame] | 10 | - name: Create directory for CORD apps and load script |
| 11 | file: |
| 12 | state: directory |
| 13 | dest: "{{ ansible_user_dir }}/cord_apps/" |
| 14 | |
| 15 | - name: Create cord_app_loader.sh script to load CORD apps |
| 16 | template: |
| 17 | src: "{{ item }}.j2" |
| 18 | dest: "{{ ansible_user_dir }}/cord_apps/{{ item }}" |
| 19 | mode: 0755 |
| 20 | with_items: |
| 21 | - cord_app_loader.sh |
| 22 | |
| 23 | - name: Copy onos-app REST API app loader tool |
| 24 | copy: |
| 25 | src: "{{ item }}" |
| 26 | dest: "{{ ansible_user_dir }}/cord_apps/{{ item }}" |
| 27 | mode: 0755 |
| 28 | with_items: |
| 29 | - onos-app |
| 30 | |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 31 | - name: Wait for ONOS to be ready |
| 32 | wait_for: |
| 33 | host: "{{ onos_cord_vm_hostname }}" |
| 34 | port: 8181 |
| 35 | |
Zack Williams | 2b94629 | 2016-08-22 15:32:29 -0700 | [diff] [blame] | 36 | - name: Download CORD apps from maven repo |
| 37 | maven_artifact: |
| 38 | repository_url: "{{ cord_apps_repo_url }}" |
| 39 | group_id: "org.opencord" |
| 40 | artifact_id: "{{ item.name }}" |
| 41 | version: "{{ cord_apps_version }}" |
| 42 | extension: "oar" |
| 43 | dest: "{{ ansible_user_dir }}/cord_apps/{{ item.name }}.oar" |
Andy Bavier | c2977cf | 2016-06-25 11:16:23 -0400 | [diff] [blame] | 44 | with_items: "{{ cord_apps }}" |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 45 | register: maven_artifact_dl |
Zack Williams | 4b7682b | 2016-06-29 18:52:08 -0700 | [diff] [blame] | 46 | |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 47 | # assumes no interruption between this and previous steps... |
Zack Williams | 2b94629 | 2016-08-22 15:32:29 -0700 | [diff] [blame] | 48 | - name: Install CORD apps |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 49 | when: maven_artifact_dl.changed |
Zack Williams | 2b94629 | 2016-08-22 15:32:29 -0700 | [diff] [blame] | 50 | command: "{{ ansible_user_dir }}/cord_apps/cord_app_loader.sh" |
Zack Williams | 4b7682b | 2016-06-29 18:52:08 -0700 | [diff] [blame] | 51 | |