Merge "Add common openstack opertation scenarios: router & port"
[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
26 - name: set build env vars
27   set_fact:
28       build_env_vars:
29         RTE_SDK: "{{ RTE_SDK }}"
30         RTE_TARGET: "{{ RTE_TARGET }}"
31         VNF_CORE: "{{ samplevnf_path }}"
32
33 - name: set soft CRC for PROX when building in VM
34   set_fact:
35       build_env_vars: "{{ build_env_vars|combine({'crc': 'soft'}) }}"
36   when: vnf_name == "PROX" and image_type is defined and image_type == "vm"
37
38 - name: "make {{ vnf_name }} clean"
39   my_make: chdir="{{ vnf_build_dir }}" target=clean extra_args="-j {{ ansible_processor_vcpus }}"
40   environment: "{{ build_env_vars }}"
41
42 - name: "make {{ vnf_name }}"
43   my_make: chdir="{{ vnf_build_dir }}" extra_args="-j {{ ansible_processor_vcpus }}"
44   environment: "{{ build_env_vars }}"
45
46 #- command: cp "{{ vnf_build_dir }}/{{ vnf_name }}/build/ip_pipeline" "{{ INSTALL_BIN_PATH }}/vACL_vnf"
47
48 - name: "Install {{ vnf_name }} VNF"
49   copy:
50     src: "{{ vnf_build_dir }}/build/{{ vnf_app_name }}"
51     dest: "{{ INSTALL_BIN_PATH }}/{{ vnf_app_name }}"
52     remote_src: True
53     # make executable
54     mode: 0755
55