blob: 1f704c67096425f314d7111d1d2efdd2f93deb06 [file] [log] [blame]
Zack Williams363bc852016-04-12 13:58:29 -07001---
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 Williams5ae57ef2016-04-12 14:01:58 -07007 template:
Zack Williams363bc852016-04-12 13:58:29 -07008 src=xos-setup-vars.yml.j2
9 dest={{ ansible_user_dir }}/xos-setup-vars.yml
10
Scott Bakerc2cd1b52016-10-26 08:53:15 -070011- 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:
24 orchestration.stat.exists == True
25
Scott Bakerfda753b2016-10-26 22:19:19 -070026- 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:
38 (orchestration.stat.exists == True) and (onos_apps.stat.exists == True)
39
Zack Williams363bc852016-04-12 13:58:29 -070040- 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
45- name: Run the XOS ansible playbook
46 command: ansible-playbook {{ ansible_user_dir }}/xos-setup-playbook.yml
Zack Williamsa3e40562016-07-05 12:05:39 -070047 async: 4800
Zack Williamsd31bbc92016-05-20 11:43:18 -070048 poll: 0
49 register: xos_setup_playbook
Zack Williams35624562016-08-28 17:12:26 -070050 tags:
51 - skip_ansible_lint # running a sub-job
Zack Williams5ae57ef2016-04-12 14:01:58 -070052