Zack Williams | b273a42 | 2016-05-18 13:33:00 -0700 | [diff] [blame] | 1 | --- |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 2 | # docker-compose/tasks/main.yml |
Zack Williams | b273a42 | 2016-05-18 13:33:00 -0700 | [diff] [blame] | 3 | |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 4 | # 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 Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 11 | - name: Wait for onos_setup_playbook to complete |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 12 | when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}" |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 13 | 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 Williams | b273a42 | 2016-05-18 13:33:00 -0700 | [diff] [blame] | 18 | |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 19 | - name: Copy SSL Certs to ONOS so docker-compose can find it |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 20 | when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}" |
Zack Williams | 644df28 | 2016-05-20 13:13:46 -0700 | [diff] [blame] | 21 | command: ansible onos-cord-1 -u ubuntu -m copy \ |
Zack Williams | 201467a | 2016-05-20 13:30:10 -0700 | [diff] [blame] | 22 | -a "src=/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt dest=~/cord/xos-certs.crt" |
Zack Williams | b273a42 | 2016-05-18 13:33:00 -0700 | [diff] [blame] | 23 | |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 24 | - name: Build ONOS image with docker-compose |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 25 | when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}" |
Zack Williams | 644df28 | 2016-05-20 13:13:46 -0700 | [diff] [blame] | 26 | command: ansible onos-cord-1 -u ubuntu -m command \ |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 27 | -a "docker-compose build chdir=cord" |
Zack Williams | 2e5d51a | 2016-05-18 16:45:22 -0700 | [diff] [blame] | 28 | |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 29 | - name: Start ONOS |
Zack Williams | 6f5a6e7 | 2016-08-10 17:45:27 -0700 | [diff] [blame] | 30 | when: "{{ head_vm_list | map(attribute='name') | list | intersect(['onos-cord-1']) | list | length }}" |
Andy Bavier | f69e77c | 2016-06-28 17:19:33 -0400 | [diff] [blame] | 31 | command: ansible onos-cord-1:onos-fabric-1 -u ubuntu -m command \ |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 32 | -a "docker-compose up -d chdir=cord" |
| 33 | |
Scott Baker | db5c8c7 | 2016-11-08 08:40:06 -0800 | [diff] [blame] | 34 | #- name: Wait for xos_setup_playbook to complete |
| 35 | # when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}" |
| 36 | # 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 |
Zack Williams | d31bbc9 | 2016-05-20 11:43:18 -0700 | [diff] [blame] | 41 | |
Scott Baker | db5c8c7 | 2016-11-08 08:40:06 -0800 | [diff] [blame] | 42 | #- name: Copy admin-openrc.sh into XOS container |
| 43 | # when: "{{ head_vm_list | map(attribute='name') | list | intersect(['xos-1']) | list | length }}" |
| 44 | # command: ansible xos-1 -u ubuntu -m copy \ |
| 45 | # -a "src=~/admin-openrc.sh dest={{ service_profile_repo_dest }}/{{ xos_configuration }}" |
| 46 | |
| 47 | - name: Copy admin-openrc.sh to service-profile |
| 48 | command: cp ~/admin-openrc.sh {{ service_profile_repo_dest }}/{{ xos_configuration }} |
| 49 | tags: |
| 50 | - skip_ansible_lint |
| 51 | # copy: |
| 52 | # src=~/admin-openrc.sh |
| 53 | # dest={{ service_profile_repo_dest }}/{{ xos_configuration }} |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame] | 54 | |
| 55 | - name: Wait for test client to complete installation |
David K. Bainbridge | 467591e | 2016-07-06 18:49:55 -0700 | [diff] [blame] | 56 | when: test_client_install is defined and test_client_install |
Zack Williams | a3e4056 | 2016-07-05 12:05:39 -0700 | [diff] [blame] | 57 | async_status: jid={{ test_client_playbook.ansible_job_id }} |
| 58 | register: test_client_playbook_result |
| 59 | until: test_client_playbook_result.finished |
| 60 | delay: 10 |
| 61 | retries: 120 |
| 62 | |