interop-workloads/workloads/ansible/openo/nfv/nfv_launch.yml

117 lines
3.6 KiB
YAML

---
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- hosts: localhost
remote_user: root
max_fail_percentage: 0
tasks:
- set_fact:
starttime: "{{ ansible_date_time }}"
- set_fact:
exec_dir: "{{ playbook_dir }}/run"
- set_fact:
opera_dir: "{{ exec_dir }}/opera"
- set_fact:
results_dir: "{{ exec_dir }}/results"
- name: Creates execution directory
file: path={{ exec_dir }} state=directory
- name: pull OPNFV Opera code
git:
repo: https://github.com/opnfv/opera.git
dest: "{{ opera_dir }}"
update: no
- name: config admin-openrc.sh
template:
src: admin-openrc.sh.j2
dest: "{{ opera_dir }}/conf/admin-openrc.sh"
- name: pull OPNFV Functest docker image to test vIMS
docker_image:
name: yaohelan/functest:stable
state: present
force: yes
- name: Creates result directory
file: path={{ results_dir }} state=directory
- name: create the opera log file
file: dest={{ results_dir }}/opera.log state=touch
- name: deploy OPEN-O and vIMS
shell: "{{ opera_dir }}/opera_launch.sh > opera.log"
args:
chdir: "{{ results_dir }}"
- name: create openstack.creds
shell: cp {{ opera_dir }}/conf/admin-openrc.sh {{ opera_dir }}/conf/openstack.creds
- name: remove OPNFV Functest docker container
shell: "docker rm -f functest-opera || true"
- name: get open-o endpoint
shell: . {{ opera_dir }}/work/scripts/open-o.conf; echo $OPENO_IP:$COMMON_SERVICES_MSB_PORT
register: openo_endpoint
- name: Creates Functest result directory
file: path={{ results_dir }}/functest state=directory
- name: run OPNFV Functest docker container
command: "docker run -id
-v {{ opera_dir }}/conf/openstack.creds:/home/opnfv/functest/conf/openstack.creds
-v {{ results_dir }}/functest:/home/opnfv/functest/results
-e INSTALLER_TYPE=unknown
-e DEPLOY_SCENARIO=unknown
-e OPENO_MSB_ENDPOINT={{ item }}
-e CI_DEBUG=false
--name=functest-opera
yaohelan/functest:stable /bin/bash"
with_items: "{{ openo_endpoint.stdout_lines }}"
- name: start OPNFV Functest docker container
command: "docker start functest-opera"
- name: run vIMS test on OPNFV Functest
command: docker exec functest-opera python /home/opnfv/repos/functest/functest/ci/run_tests.py -t opera_ims
- name: copy call information
command: docker cp functest-opera:/home/opnfv/functest/results/opera_ims/ellis.info {{ results_dir }}/ellis.info
- name: get end time
shell: date '+%H:%M:%S'
register: end_time
- debug:
msg: >-
Access OPEN-O dashboard at
http://{{ openo_endpoint.stdout_lines }}
- name: get Ellis call information
command: /bin/cat {{ results_dir }}/ellis.info
register: details
- debug:
msg: >-
Ellis details
{{ details.stdout_lines }}
- debug:
msg: >-
The work load started at {{ starttime.time }},
ended at {{ end_time.stdout }}