blob: 7ecf5b3e231d433201d557a16d2925749c1a44e1 [file] [log] [blame]
---
# xos-vm-install/tasks/main.yml
#
# Install XOS on a sub vm by calling ansible
- name: Create a vars file from template
template:
src=xos-setup-vars.yml.j2
dest={{ ansible_user_dir }}/xos-setup-vars.yml
- name: Check to see if orchestration directory exists
local_action: stat path="{{ playbook_dir }}/../../orchestration"
register: orchestration
- name: Make xos_install directory
file: path="{{ ansible_user_dir }}/xos_install" state=directory
when: orchestration.stat.exists == True
- name: Copy repositories to the head node
synchronize:
src: "{{ playbook_dir }}/../../orchestration"
dest: "{{ ansible_user_dir }}/xos_install/"
when:
False # orchestration.stat.exists == True
- name: Check to see if onos_apps directory exists
local_action: stat path="{{ playbook_dir }}/../../onos-apps/apps"
register: onos_apps
- name: Copy in onos-apps that have XOS code
synchronize:
src: "{{ playbook_dir }}/../../onos-apps/apps/{{ item }}"
dest: "{{ ansible_user_dir }}/xos_install/orchestration/xos_services/"
with_items:
- vtn
- olt
when:
False # (orchestration.stat.exists == True) and (onos_apps.stat.exists == True)
- name: Copy over XOS ansible playbook
copy:
src=xos-setup-{{ xos_configuration }}-playbook.yml
dest={{ ansible_user_dir }}/xos-setup-playbook.yml
- name: Create template directory
file: path="{{ ansible_user_dir }}/templates" state=directory
- name: Copy over necessary templates
copy:
src={{ item }}
dest={{ ansible_user_dir }}/templates/{{ item }}
with_items:
- docker.j2
- name: Run the XOS ansible playbook
command: ansible-playbook {{ ansible_user_dir }}/xos-setup-playbook.yml
async: 4800
poll: 0
register: xos_setup_playbook
tags:
- skip_ansible_lint # running a sub-job