blob: a623cf1dc8ecba675c73edffbcb92cb7578d4396 [file] [log] [blame]
Zack Williamsb273a422016-05-18 13:33:00 -07001---
Zack Williamsd31bbc92016-05-20 11:43:18 -07002# docker-compose/tasks/main.yml
Zack Williamsb273a422016-05-18 13:33:00 -07003
Zack Williams6f5a6e72016-08-10 17:45:27 -07004# The following two tests are equivalent and both evaluate to 0 when
5# `onos-cord-1` VM isn't set to be created, but the `equalto` test only exists
6# in Jinja v2.7.4, which is later than what's in Ubuntu 14.04 (v2.7.2).
7#
8# {{ head_vm_list | selectattr('name', 'equalto', 'onos-cord-1') | list | length }}
9# {{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}
10
Zack Williamsd31bbc92016-05-20 11:43:18 -070011- name: Wait for onos_setup_playbook to complete
Zack Williams6f5a6e72016-08-10 17:45:27 -070012 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
Zack Williamsd31bbc92016-05-20 11:43:18 -070013 async_status: jid={{ onos_setup_playbook.ansible_job_id }}
14 register: onos_setup_playbook_result
15 until: onos_setup_playbook_result.finished
16 delay: 10
17 retries: 120
Zack Williamsb273a422016-05-18 13:33:00 -070018
Zack Williamsd31bbc92016-05-20 11:43:18 -070019- name: Copy SSL Certs to ONOS so docker-compose can find it
Zack Williams6f5a6e72016-08-10 17:45:27 -070020 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
Zack Williams644df282016-05-20 13:13:46 -070021 command: ansible onos-cord-1 -u ubuntu -m copy \
Zack Williams201467a2016-05-20 13:30:10 -070022 -a "src=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt dest=~/cord/xos-certs.crt"
Zack Williamsb273a422016-05-18 13:33:00 -070023
Zack Williamsd31bbc92016-05-20 11:43:18 -070024- name: Build ONOS image with docker-compose
Zack Williams6f5a6e72016-08-10 17:45:27 -070025 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
Zack Williams644df282016-05-20 13:13:46 -070026 command: ansible onos-cord-1 -u ubuntu -m command \
Zack Williamsd31bbc92016-05-20 11:43:18 -070027 -a "docker-compose build chdir=cord"
Zack Williams2e5d51a2016-05-18 16:45:22 -070028
Zack Williamsd31bbc92016-05-20 11:43:18 -070029- name: Start ONOS
Zack Williams6f5a6e72016-08-10 17:45:27 -070030 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}"
Andy Bavierf69e77c2016-06-28 17:19:33 -040031 command: ansible onos-cord-1:onos-fabric-1 -u ubuntu -m command \
Zack Williamsd31bbc92016-05-20 11:43:18 -070032 -a "docker-compose up -d chdir=cord"
33
34- name: Wait for xos_setup_playbook to complete
Zack Williams6f5a6e72016-08-10 17:45:27 -070035 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}"
Zack Williamsd31bbc92016-05-20 11:43:18 -070036 async_status: jid={{ xos_setup_playbook.ansible_job_id }}
37 register: xos_setup_playbook_result
38 until: xos_setup_playbook_result.finished
39 delay: 10
40 retries: 120
41
42- name: Copy admin-openrc.sh into XOS container
Zack Williams6f5a6e72016-08-10 17:45:27 -070043 when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}"
Zack Williams644df282016-05-20 13:13:46 -070044 command: ansible xos-1 -u ubuntu -m copy \
Andy Bavier3a1d0642016-07-01 14:11:39 -040045 -a "src=~/admin-openrc.sh dest={{ service_profile_repo_dest }}/{{ xos_configuration }}"
Zack Williamsa3e40562016-07-05 12:05:39 -070046
47- name: Wait for test client to complete installation
David K. Bainbridge467591e2016-07-06 18:49:55 -070048 when: test_client_install is defined and test_client_install
Zack Williamsa3e40562016-07-05 12:05:39 -070049 async_status: jid={{ test_client_playbook.ansible_job_id }}
50 register: test_client_playbook_result
51 until: test_client_playbook_result.finished
52 delay: 10
53 retries: 120
54