Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 1 | --- |
| 2 | # xos-vm-install/tasks/main.yml |
| 3 | # |
| 4 | # Install XOS on a sub vm by calling ansible |
| 5 | |
| 6 | - name: Create a vars file from template |
Zack Williams | 5ae57ef | 2016-04-12 14:01:58 -0700 | [diff] [blame] | 7 | template: |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 8 | src=xos-setup-vars.yml.j2 |
| 9 | dest={{ ansible_user_dir }}/xos-setup-vars.yml |
| 10 | |
Scott Baker | c2cd1b5 | 2016-10-26 08:53:15 -0700 | [diff] [blame] | 11 | - name: Check to see if orchestration directory exists |
| 12 | local_action: stat path="{{ playbook_dir }}/../../orchestration" |
| 13 | register: orchestration |
| 14 | |
| 15 | - name: Make xos_install directory |
| 16 | file: path="{{ ansible_user_dir }}/xos_install" state=directory |
| 17 | when: orchestration.stat.exists == True |
| 18 | |
| 19 | - name: Copy repositories to the head node |
| 20 | synchronize: |
| 21 | src: "{{ playbook_dir }}/../../orchestration" |
| 22 | dest: "{{ ansible_user_dir }}/xos_install/" |
| 23 | when: |
Scott Baker | c7a0256 | 2016-10-28 14:38:29 -0700 | [diff] [blame] | 24 | False # orchestration.stat.exists == True |
Scott Baker | c2cd1b5 | 2016-10-26 08:53:15 -0700 | [diff] [blame] | 25 | |
Scott Baker | fda753b | 2016-10-26 22:19:19 -0700 | [diff] [blame] | 26 | - name: Check to see if onos_apps directory exists |
| 27 | local_action: stat path="{{ playbook_dir }}/../../onos-apps/apps" |
| 28 | register: onos_apps |
| 29 | |
| 30 | - name: Copy in onos-apps that have XOS code |
| 31 | synchronize: |
| 32 | src: "{{ playbook_dir }}/../../onos-apps/apps/{{ item }}" |
| 33 | dest: "{{ ansible_user_dir }}/xos_install/orchestration/xos_services/" |
| 34 | with_items: |
| 35 | - vtn |
| 36 | - olt |
| 37 | when: |
Scott Baker | c7a0256 | 2016-10-28 14:38:29 -0700 | [diff] [blame] | 38 | False # (orchestration.stat.exists == True) and (onos_apps.stat.exists == True) |
Scott Baker | fda753b | 2016-10-26 22:19:19 -0700 | [diff] [blame] | 39 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 40 | - name: Copy over XOS ansible playbook |
| 41 | copy: |
| 42 | src=xos-setup-{{ xos_configuration }}-playbook.yml |
| 43 | dest={{ ansible_user_dir }}/xos-setup-playbook.yml |
| 44 | |
Scott Baker | 99ba01e | 2016-11-03 15:55:17 -0700 | [diff] [blame] | 45 | - name: Create template directory |
| 46 | file: path="{{ ansible_user_dir }}/templates" state=directory |
| 47 | |
| 48 | - name: Copy over necessary templates |
| 49 | copy: |
| 50 | src={{ item }} |
| 51 | dest={{ ansible_user_dir }}/templates/{{ item }} |
| 52 | with_items: |
| 53 | - docker.j2 |
| 54 | |
Zack Williams | 363bc85 | 2016-04-12 13:58:29 -0700 | [diff] [blame] | 55 | - name: Run the XOS ansible playbook |
| 56 | command: ansible-playbook {{ ansible_user_dir }}/xos-setup-playbook.yml |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame] | 57 | async: 4800 |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 58 | poll: 0 |
| 59 | register: xos_setup_playbook |
Zack Williams | 3562456 | 2016-08-28 17:12:26 -0700 | [diff] [blame] | 60 | tags: |
| 61 | - skip_ansible_lint # running a sub-job |
Zack Williams | 5ae57ef | 2016-04-12 14:01:58 -0700 | [diff] [blame] | 62 | |