Cleanup unittests for test_attacker_baremetal
[yardstick.git] / ansible / roles / install_yardstick / tasks / main.yml
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 # Arguments needed: map_min_addr_file, yardstick_dir
16
17 - name: Define variables
18   set_fact:
19     map_min_addr_file: "/etc/sysctl.d/mmap_min_addr.conf"
20
21 - name: Remove the kernel minimum virtual address restriction that a process is allowed to mmap
22   copy:
23     dest: "{{ map_min_addr_file }}"
24     content: "vm.mmap_min_addr = 0\n"
25
26 - name: Config git SSL
27   git_config:
28     name: http.sslVerify
29     scope: global
30     value: False
31
32 # There is a bug with the easy install ansible module in suse linux.
33 # Until this is fixed the shell command must be used
34 - name: Install pip
35   shell: easy_install -U pip
36 #    easy_install:
37 #    name: pip
38 #    state: latest
39
40 - name: Install Yardstick requirements (venv)
41   pip:
42     requirements: "{{ yardstick_dir }}/requirements.txt"
43     virtualenv: "{{ yardstick_dir }}/virtualenv"
44   async: 900
45   poll: 0
46   register: pip_installer
47   when: virtual_environment == True
48
49 - name: Install Yardstick requirements
50   pip:
51     requirements: "{{ yardstick_dir }}/requirements.txt"
52   async: 900
53   poll: 0
54   register: pip_installer
55   when: virtual_environment == False
56
57 - name: Check install Yardstick requirements
58   async_status:
59     jid: "{{ pip_installer.ansible_job_id }}"
60   register: job_result
61   until: job_result.finished
62   retries: 180
63
64 - name: Install Yardstick code (venv)
65   pip:
66     name: "{{ yardstick_dir }}/"
67     editable: True
68     virtualenv: "{{ yardstick_dir }}/virtualenv"
69   when: virtual_environment == True
70
71 - name: Install Yardstick code
72   pip:
73     name: "{{ yardstick_dir }}/"
74     editable: True
75   when: virtual_environment == False