Merge "Add "volumes" parameter in Kubernetes context"
[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     - download_trex
39     - install_trex
40     - configure_rabbitmq
41
42   post_tasks:
43
44     - service:
45         name: nginx
46         state: restarted
47       when: installation_mode != inst_mode_container
48
49     - shell: uwsgi -i /etc/yardstick/yardstick.ini
50       when: installation_mode != inst_mode_container
51
52 - name: Prepare baremetal and standalone server(s)
53   hosts: yardstick-baremetal,yardstick-standalone
54   become: yes
55   vars:
56     YARD_IMG_ARCH: "{{ arch_amd64 }}"
57   environment:
58     proxy_env:
59       http_proxy: "{{ lookup('env', 'http_proxy') }}"
60       https_proxy: "{{ lookup('env', 'https_proxy') }}"
61       ftp_proxy: "{{ lookup('env', 'ftp_proxy') }}"
62       no_proxy: "{{ lookup('env', 'no_proxy') }}"
63
64   roles:
65     - add_custom_repos
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     # needed for collectd plugins
71     - increase_open_file_limits
72     - install_image_dependencies
73     - role: download_dpdk
74     # dpdk_version: "17.02"
75     - install_dpdk
76     - download_trex
77     - install_trex
78     - download_civetweb
79     - install_civetweb
80     - download_samplevnfs
81     - role: install_samplevnf
82       vnf_name: PROX
83     - role: install_samplevnf
84       vnf_name: UDP_Replay
85     - role: install_samplevnf
86       vnf_name: ACL
87     - role: install_samplevnf
88       vnf_name: FW
89     - role: install_samplevnf
90       vnf_name: CGNATP
91     # build shared DPDK for collectd only, required DPDK downloaded already
92     - install_dpdk_shared
93     - install_rabbitmq
94     - download_intel_cmt_cat
95     - install_intel_cmt_cat
96     - download_pmu_tools
97     - install_pmu_tools
98     - download_collectd
99     - install_collectd