Merge "Clean-up tests in test_vsperf_dpdk.py:VsperfDPDKTestCase"
[yardstick.git] / ansible / install.yaml
1 # Copyright (c) 2018 Intel Corporation.
2 #
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
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 ---
15 - hosts: jumphost
16   become: yes
17   vars:
18     installation_mode: "{{ INSTALLATION_MODE | default('baremetal') }}"
19     yardstick_dir: "{{ YARDSTICK_DIR | default('/home/opnfv/repos/yardstick') }}"
20     virtual_environment: "{{ VIRTUAL_ENVIRONMENT | default(False) }}"
21     nsb_dir: "{{ NSB_DIR | default('/opt/nsb_bin/') }}"
22
23   pre_tasks:
24
25     - name: Create NSB binaries directory, accesible to any user
26       file:
27         path: "{{ nsb_dir }}"
28         state: directory
29         owner: root
30         mode: 0777
31
32   roles:
33     - add_repos_jumphost
34     - install_dependencies_jumphost
35     - install_yardstick
36     - configure_uwsgi
37     - configure_nginx
38     - configure_gui
39     - download_trex
40     - install_trex
41     - configure_rabbitmq
42
43   post_tasks:
44
45     - service:
46         name: nginx
47         state: restarted
48       when: installation_mode != inst_mode_container
49
50     - shell: uwsgi -i /etc/yardstick/yardstick.ini
51       when: installation_mode != inst_mode_container
52
53 - name: Prepare baremetal and standalone server(s)
54   hosts: yardstick-baremetal,yardstick-standalone
55   become: yes
56   vars:
57     YARD_IMG_ARCH: "{{ arch_amd64 }}"
58   environment:
59     proxy_env:
60       http_proxy: "{{ lookup('env', 'http_proxy') }}"
61       https_proxy: "{{ lookup('env', 'https_proxy') }}"
62       ftp_proxy: "{{ lookup('env', 'ftp_proxy') }}"
63       no_proxy: "{{ lookup('env', 'no_proxy') }}"
64
65   roles:
66     - add_custom_repos
67     - role: set_package_installer_proxy
68       when: proxy_env is defined and proxy_env
69     # can't update grub in chroot/docker
70     - enable_hugepages_on_boot
71     # needed for collectd plugins
72     - increase_open_file_limits
73     - install_image_dependencies
74     - role: download_dpdk
75     # dpdk_version: "17.02"
76     - install_dpdk
77     - download_trex
78     - install_trex
79     - download_civetweb
80     - install_civetweb
81     - download_samplevnfs
82     - role: install_samplevnf
83       vnf_name: PROX
84     - role: install_samplevnf
85       vnf_name: UDP_Replay
86     - role: install_samplevnf
87       vnf_name: ACL
88     - role: install_samplevnf
89       vnf_name: FW
90     - role: install_samplevnf
91       vnf_name: CGNAPT
92     # build shared DPDK for collectd only, required DPDK downloaded already
93     - install_dpdk_shared
94     - install_rabbitmq
95     - download_intel_cmt_cat
96     - install_intel_cmt_cat
97     - download_pmu_tools
98     - install_pmu_tools
99     - download_collectd
100     - install_collectd