b5d33f668b3d19fdadd8ca1aaed0410f0c1f71ec
[yardstick.git] / ansible / roles / install_samplevnf / tasks / main.yml
1 # Copyright (c) 2017 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 - set_fact:
16     vnf_build_dir: "{{ samplevnf_path }}/VNFs/{{ vnf_build_dirs[vnf_name] }}"
17
18 - set_fact:
19     vnf_app_name: "{{ vnf_app_names[vnf_name] }}"
20
21 - name: Install extra build dependencies
22   action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
23   with_items: "{{ vnf_build_dependencies.get(vnf_name, {}).get(ansible_os_family, []) }}"
24
25 - name: set build env vars
26   set_fact:
27       build_env_vars:
28         RTE_SDK: "{{ RTE_SDK }}"
29         RTE_TARGET: "{{ RTE_TARGET }}"
30         VNF_CORE: "{{ samplevnf_path }}"
31
32 - name: set soft CRC and GEN_DECAP_IPV6_TO_IPV4_CKSUM for PROX when building in VM
33   set_fact:
34       build_env_vars: "{{ build_env_vars|combine({'crc': 'soft'})|combine({'GEN_DECAP_IPV6_TO_IPV4_CKSUM':'y'}) }}"
35   when: vnf_name == "PROX" and image_type is defined and image_type == "vm"
36
37 - name: "make {{ vnf_name }} clean"
38   command: make -j {{ ansible_processor_vcpus }} clean
39   args:
40     chdir: "{{ vnf_build_dir }}"
41   environment: "{{ build_env_vars }}"
42
43 - name: "make {{ vnf_name }}"
44   command: make -j {{ ansible_processor_vcpus }}
45   args:
46     chdir: "{{ vnf_build_dir }}"
47   environment: "{{ build_env_vars }}"
48
49 #- command: cp "{{ vnf_build_dir }}/{{ vnf_name }}/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vACL_vnf"
50
51 - name: "Install {{ vnf_name }} VNF"
52   copy:
53     src: "{{ vnf_build_dir }}/build/{{ vnf_app_name }}"
54     dest: "{{ INSTALL_BIN_PATH }}/{{ vnf_app_name }}"
55     remote_src: True
56     # make executable
57     mode: 0755
58