1 # Copyright (c) 2018-2019 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 yardstick_dir: "{{ YARDSTICK_DIR | default('/home/opnfv/repos/yardstick') }}"
19 virtual_environment: "{{ VIRTUAL_ENVIRONMENT | default(False) }}"
20 nsb_dir: "{{ NSB_DIR | default('/opt/nsb_bin/') }}"
24 - name: Create NSB binaries directory, accessible to any user
31 - installation_mode != inst_mode_container_pull
35 - install_dependencies_jumphost
36 - { role: install_yardstick, when: installation_mode != inst_mode_container_pull }
37 - { role: configure_uwsgi, when: installation_mode != inst_mode_container_pull }
38 - { role: configure_nginx, when: installation_mode != inst_mode_container_pull }
39 - { role: configure_gui, when: installation_mode != inst_mode_container_pull }
40 - { role: download_trex, when: installation_mode != inst_mode_container_pull }
41 - { role: install_trex, when: installation_mode != inst_mode_container_pull }
42 - role: configure_rabbitmq
43 install_mode: "{{ installation_mode }}"
51 when: installation_mode == inst_mode_baremetal
53 - shell: uwsgi -i /etc/yardstick/yardstick.ini
54 when: installation_mode == inst_mode_baremetal
57 - name: Prepare baremetal and standalone servers
58 hosts: yardstick-baremetal,yardstick-standalone
61 - roles/download_dpdk/defaults/main.yml
62 environment: "{{ proxy_env }}"
66 - role: set_package_installer_proxy
67 when: proxy_env is defined and proxy_env
68 # can't update grub in chroot/docker
69 - enable_hugepages_on_boot
70 - enable_iommu_on_boot
71 - enable_cpu_isolation_on_boot
72 # needed for collectd plugins
73 - increase_open_file_limits
74 - install_image_dependencies
76 dpdk_version: "{{ dpdk_version_for_PROX }}"
78 dpdk_version: "{{ dpdk_version_for_PROX }}"
80 - role: install_samplevnf
88 - role: install_samplevnf
90 - role: install_samplevnf
92 - role: install_samplevnf
94 - role: install_samplevnf
96 # build shared DPDK for collectd only, required DPDK downloaded already
99 - download_intel_cmt_cat
100 - install_intel_cmt_cat
109 - name: Prepare to build VM
113 img_prop_item: "{{ IMG_PROPERTY }}"
114 img_arch: "{{ YARD_IMG_ARCH }}"
117 - name: Include pre-build
119 name: build_yardstick_image
120 tasks_from: pre_build.yml
122 - installation_mode != inst_mode_container
123 - IMG_PROPERTY == 'nsb' or IMG_PROPERTY == 'normal'
126 - name: Build VM in chroot
131 img_property: "{{ IMG_PROPERTY }}"
132 environment: "{{ proxy_env }}"
135 - name: Include image build
137 name: build_yardstick_image
138 tasks_from: "cloudimg_modify_{{ img_property }}.yml"
140 - installation_mode != inst_mode_container
141 - IMG_PROPERTY == 'nsb' or IMG_PROPERTY == 'normal'
144 - name: Clear up after VM is built
149 - name: Include post-build
151 name: build_yardstick_image
152 tasks_from: post_build.yml
154 - installation_mode != inst_mode_container
155 - IMG_PROPERTY == 'nsb' or IMG_PROPERTY == 'normal'
158 - name: Add OpenStack variables, image
163 - yardstick_config.yml
166 - name: Get information about external VM image
168 path: "{{ path_to_img }}"
169 register: image_file_stat
171 - path_to_img is defined
172 - imgfile is not defined
175 imgfile: "{{ path_to_img }}"
177 - path_to_img is defined
178 - imgfile is not defined
179 - image_file_stat.stat.islnk is defined
180 - not image_file_stat.stat.islnk
185 - openrc_file is defined
189 - { role: convert_openrc, when: openrc_file is defined }
190 - { role: clean_images, when: openrc_flag }
191 - { role: clean_flavors, when: openrc_flag }
192 - { role: create_samplevnfs_image, when: openrc_flag }
194 "{{ openrc | default({}) }}"
197 - name: Start yardstick container on jumphost
201 - name: Install docker needed to pull Yardstick container
204 when: installation_mode == inst_mode_container_pull
206 - name: Start yardstick container
211 image: "{{ yardstick_docker_image|default('opnfv/yardstick:latest') }}"
213 restart_policy: always
217 - "{{ openrc_file|default('/dev/null') }}:/etc/yardstick/openstack.creds:ro"
218 - /var/run/docker.sock:/var/run/docker.sock
220 - /etc/localtime:/etc/localtime:ro
221 when: installation_mode == inst_mode_container_pull