blob: 7ecf5b3e231d433201d557a16d2925749c1a44e1 [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:
Scott Bakerc7a02562016-10-28 14:38:29 -070024 False # orchestration.stat.exists == True
Scott Bakerc2cd1b52016-10-26 08:53:15 -070025
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:
Scott Bakerc7a02562016-10-28 14:38:29 -070038 False # (orchestration.stat.exists == True) and (onos_apps.stat.exists == True)
Scott Bakerfda753b2016-10-26 22:19:19 -070039
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
Scott Baker99ba01e2016-11-03 15:55:17 -070045- 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 Williams363bc852016-04-12 13:58:29 -070055- name: Run the XOS ansible playbook
56 command: ansible-playbook {{ ansible_user_dir }}/xos-setup-playbook.yml
Zack Williamsa3e40562016-07-05 12:05:39 -070057 async: 4800
Zack Williamsd31bbc92016-05-20 11:43:18 -070058 poll: 0
59 register: xos_setup_playbook
Zack Williams35624562016-08-28 17:12:26 -070060 tags:
61 - skip_ansible_lint # running a sub-job
Zack Williams5ae57ef2016-04-12 14:01:58 -070062