1 # Copyright (c) 2018-2019 Intel Corporation.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 - name: Get CNI driver sources
17 repo: "{{ item.value.repo_url }}"
18 dest: "{{ cni_src_dir }}/{{ item.key }}"
19 version: "{{ item.value.repo_ver }}"
20 with_dict: "{{ cni_info }}"
22 - name: Compile CNI drivers
23 command: "{{ cni_src_dir }}/{{ item.key }}/{{ item.value.build_script }}"
24 environment: "{{ go_env }}"
26 chdir: "{{ cni_src_dir }}/{{ item.key }}"
27 with_dict: "{{ cni_info }}"
29 - name: Get list of compiled CNI binaries
30 shell: ls -1 {{ item.key }}/bin/*
31 register: ls_cni_binaries_result
33 chdir: "{{ cni_src_dir }}"
34 with_dict: "{{ cni_info }}"
37 cni_binary_list: "{{ cni_binary_list|default([]) + item.stdout_lines }}"
38 with_items: "{{ ls_cni_binaries_result.results }}"
40 - name: Create CNI binaries dir
41 file: path={{ cni_bin_dir }} state=directory
43 - name: Copy CNI binaries into kublet bin dir
45 src: "{{ cni_src_dir }}/{{ item }}"
46 dest: "{{ cni_bin_dir }}/"
49 with_items: "{{ cni_binary_list }}"