| --- |
| # 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: |
| 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: |
| (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: 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 |
| |