blob: 49dafaf442e5bf1a199231e8b6b5aaf8b94eff4e [file] [log] [blame]
Andy Bavier5a6bfbd2018-01-26 10:20:29 -08001---
2
3# Copyright 2017-present Open Networking Foundation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17- name: Get ID of VM
18 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova list --all-tenants|grep mysite_venb|cut -d '|' -f 2"
19 register: nova_id
20 tags:
21 - skip_ansible_lint # running a sub job
22
23- name: Get mgmt IP of VM
24 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova interface-list {{ nova_id.stdout }}|grep -o -m 1 '172\.27\.[[:digit:]]*\.[[:digit:]]*'"
25 register: mgmt_ip
26 tags:
27 - skip_ansible_lint # running a sub job
28
29- name: Get name of compute node
30 shell: bash -c "source /opt/cord_profile/admin-openrc.sh; nova show {{ nova_id.stdout }}|grep hypervisor_hostname|cut -d '|' -f 3"
31 register: node_name
32 tags:
33 - skip_ansible_lint # running a sub job
34
35- name: Write email address to file
36 shell: sshpass -p {{ mcord_ng40_password }} ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" {{ mcord_ng40_login }}@{{ mgmt_ip.stdout }} "sudo bash -c 'echo {{ mcord_ng40_license_email }} > /opt/ng4t/etc/email'"
37 tags:
38 - skip_ansible_lint # running a sub job
39
40- name: Run ./verify_quick.sh and check for VERDICT_PASS
41 shell: sshpass -p {{ mcord_ng40_password }} ssh -o ProxyCommand="ssh -W %h:%p -l ubuntu {{ node_name.stdout }}" {{ mcord_ng40_login }}@{{ mgmt_ip.stdout }} "./verify_quick.sh"
42 register: result
43 failed_when: "'VERDICT_PASS' not in result.stdout"
44 tags:
45 - skip_ansible_lint # running a sub job
46
47- name: Print result of test
48 debug:
49 var: result.stdout_lines