Andy Bavier | 8cdaa5f | 2016-12-07 12:32:16 -0500 | [diff] [blame] | 1 | --- |
| 2 | # platform-check/tasks/main.yml |
| 3 | |
| 4 | - name: Ensure br-int exists on all compute nodes (check VTN) |
| 5 | shell: ansible -i /etc/maas/ansible/pod-inventory compute -u ubuntu -m shell -s -a "ovs-vsctl br-exists br-int" |
| 6 | register: result |
| 7 | until: result | success |
| 8 | retries: 6 |
| 9 | delay: 10 |
| 10 | ignore_errors: yes |
| 11 | tags: |
| 12 | - skip_ansible_lint # running a sub job |
| 13 | |
| 14 | # Work around issues with ONOS intialization |
| 15 | - name: Restart ONOS when VTN initialization failed |
| 16 | when: result | failed |
| 17 | shell: docker-compose stop; docker-compose rm -f; docker-compose up -d |
| 18 | args: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 19 | chdir: "{{ head_onos_cord_dir }}" |
Andy Bavier | 8cdaa5f | 2016-12-07 12:32:16 -0500 | [diff] [blame] | 20 | tags: |
| 21 | - skip_ansible_lint |
| 22 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 23 | - name: Tell XOS to refresh VTN Service and compute nodes |
Andy Bavier | 8cdaa5f | 2016-12-07 12:32:16 -0500 | [diff] [blame] | 24 | when: result | failed |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 25 | xostosca: |
| 26 | url: "http://xos.{{ site_suffix }}:{{ xos_ui_port }}/api/utility/tosca/run/" |
| 27 | user: "{{ xos_admin_user }}" |
| 28 | password: "{{ xos_admin_pass }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 29 | recipe: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 30 | with_items: |
| 31 | - openstack.yaml |
| 32 | - openstack-compute.yaml |
| 33 | - vtn-service.yaml |
| 34 | |
| 35 | - name: Pause to work around race in VTN or ONOS synchronizers |
| 36 | pause: |
| 37 | seconds: 20 |
| 38 | |
| 39 | - name: Enable VTN for OpenStack Compute nodes |
| 40 | when: result | failed |
| 41 | xostosca: |
| 42 | url: "http://xos.{{ site_suffix }}:{{ xos_ui_port }}/api/utility/tosca/run/" |
| 43 | user: "{{ xos_admin_user }}" |
| 44 | password: "{{ xos_admin_pass }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 45 | recipe: "{{ lookup('file', head_cord_profile_dir + '/' + item ) }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 46 | with_items: |
| 47 | - openstack-compute-vtn.yaml |
Andy Bavier | 8cdaa5f | 2016-12-07 12:32:16 -0500 | [diff] [blame] | 48 | |
| 49 | - name: Ensure br-int exists on all compute nodes (check VTN #2) |
| 50 | when: result | failed |
| 51 | shell: ansible -i /etc/maas/ansible/pod-inventory compute -u ubuntu -m shell -s -a "ovs-vsctl br-exists br-int" |
| 52 | register: result2 |
| 53 | until: result2 | success |
| 54 | retries: 12 |
| 55 | delay: 10 |
| 56 | tags: |
| 57 | - skip_ansible_lint # running a sub job |
| 58 | |