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 virtual_environment: "{{ VIRTUAL_ENVIRONMENT | default(False) }}"
19 nsb_dir: "{{ NSB_DIR | default('/opt/nsb_bin/') }}"
23 - name: Create NSB binaries directory, accessible to any user
30 - installation_mode != inst_mode_container_pull
34 - install_dependencies_jumphost
35 - { role: install_yardstick, when: installation_mode != inst_mode_container_pull }
36 - { role: configure_uwsgi, when: installation_mode != inst_mode_container_pull }
37 - { role: configure_nginx, when: installation_mode != inst_mode_container_pull }
38 - { role: configure_gui, when: installation_mode != inst_mode_container_pull }
39 - { role: download_trex, when: installation_mode != inst_mode_container_pull }
40 - { role: install_trex, when: installation_mode != inst_mode_container_pull }
41 - role: configure_rabbitmq
42 install_mode: "{{ installation_mode }}"
50 when: installation_mode == inst_mode_baremetal
52 - shell: uwsgi -i /etc/yardstick/yardstick.ini
53 when: installation_mode == inst_mode_baremetal
56 - name: Prepare baremetal and standalone servers
57 hosts: yardstick-baremetal,yardstick-standalone
60 - roles/download_dpdk/defaults/main.yml
61 environment: "{{ proxy_env }}"
65 - role: set_package_installer_proxy
66 when: proxy_env is defined and proxy_env
67 # can't update grub in chroot/docker
68 - enable_hugepages_on_boot
69 - enable_iommu_on_boot
70 - enable_cpu_isolation_on_boot
71 # needed for collectd plugins
72 - increase_open_file_limits
73 - install_image_dependencies
75 dpdk_version: "{{ dpdk_version_for_PROX }}"
77 dpdk_version: "{{ dpdk_version_for_PROX }}"
79 - role: install_samplevnf
87 - role: install_samplevnf
89 - role: install_samplevnf
91 - role: install_samplevnf
93 - role: install_samplevnf
95 # build shared DPDK for collectd only, required DPDK downloaded already
98 - download_intel_cmt_cat
99 - install_intel_cmt_cat
107 - name: Prepare to build VM
108 hosts: yardstick-standalone
111 img_prop_item: "{{ IMG_PROPERTY }}"
112 img_arch: "{{ YARD_IMG_ARCH }}"
113 environment: "{{ proxy_env }}"
121 - name: Copy ansible folder to remote DUT
126 - name: Install DUT related packages
128 name: "{{ packages }}"
137 # There is a bug with the easy install ansible module in Ubuntu 16.04 linux.
138 # Refer https://github.com/ansible/ansible/issues/23534
140 shell: easy_install -U pip
142 - ansible_distribution == 'Ubuntu'
143 - ansible_distribution_major_version|int <= 16
145 - name: Install python-pip
146 action: "{{ ansible_pkg_mgr }} name=python-pip state=present"
148 - ansible_distribution == 'Ubuntu'
149 - ansible_distribution_major_version|int >= 17
151 - name: Update pip ansible docker
153 name: "ansible==2.5.5"
155 # This is used as workaround as ansible doesn't support chroot on remote server
156 - name: Run ansible on remote
157 shell: "ansible-playbook -e OS_RELEASE={{ OS_RELEASE }} -e IMAGE_PROPERTY={{ IMAGE_PROPERTY }} -e YARD_IMAGE_ARCH={{ YARD_IMAGE_ARCH }} -i install-inventory.ini build_vm.yml -vv"
159 chdir: "/tmp/ansible"
162 - name: Add OpenStack variables, image
167 - yardstick_config.yml
170 - name: Get information about external VM image
172 path: "{{ path_to_img }}"
173 register: image_file_stat
175 - path_to_img is defined
176 - imgfile is not defined
179 imgfile: "{{ path_to_img }}"
181 - path_to_img is defined
182 - imgfile is not defined
183 - image_file_stat.stat.islnk is defined
184 - not image_file_stat.stat.islnk
189 - openrc_file is defined
193 - { role: convert_openrc, when: openrc_file is defined }
194 - { role: clean_images, when: openrc_flag }
195 - { role: clean_flavors, when: openrc_flag }
196 - { role: create_samplevnfs_image, when: openrc_flag }
198 "{{ openrc | default({}) }}"
201 - name: Start yardstick container on jumphost
205 - name: Install docker needed to pull Yardstick container
208 when: installation_mode == inst_mode_container_pull
210 - name: Start yardstick container
215 image: "{{ yardstick_docker_image|default('opnfv/yardstick:latest') }}"
217 restart_policy: always
221 - "{{ openrc_file|default('/dev/null') }}:/etc/yardstick/openstack.creds:ro"
222 - /var/run/docker.sock:/var/run/docker.sock
223 - /etc/localtime:/etc/localtime:ro
224 when: installation_mode == inst_mode_container_pull