Infra: Ansible yaml lint cleanup
[csit.git] / fdio.infra.ansible / roles / trex / tasks / deploy_block.yaml
1 ---
2 # file: roles/trex/tasks/deploy_block.yaml
3
4 - name: Get Release {{ item }}
5   get_url:
6     url: "{{ trex_url }}/v{{ item }}.tar.gz"
7     dest: "{{ trex_target_dir }}/trex-core-{{ item }}.tar.gz"
8     validate_certs: false
9     mode: 0644
10   register: trex_downloaded
11
12 - name: Create Directory {{ item }}
13   file:
14     path: "{{ trex_target_dir }}/trex-core-{{ item }}"
15     state: "directory"
16
17 - name: Extract Release {{ item }}
18   unarchive:
19     remote_src: true
20     src: "{{ trex_target_dir }}/trex-core-{{ item }}.tar.gz"
21     dest: "{{ trex_target_dir }}/"
22     creates: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
23   register: trex_extracted
24
25 - name: Patch Azure
26   patch:
27     src: "files/t-rex.patch"
28     basedir: "{{ trex_target_dir }}/trex-core-{{ item }}"
29     strip: 1
30   when:
31     - azure is defined and item == "2.73"
32
33 - name: Compile Release {{ item }} Part I
34   command: "./b configure"
35   args:
36     chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
37   when: trex_extracted.changed
38
39 - name: Compile Release {{ item }} Part II
40   command: "./b build"
41   args:
42     chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
43   when: trex_extracted.changed
44
45 - name: Compile Release {{ item }} Part III
46   command: "make -j 16"
47   args:
48     chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/scripts/ko/src"
49   when: trex_extracted.changed
50
51 - name: Compile Release {{ item }} Part IV
52   command: "make install"
53   args:
54     chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/scripts/ko/src"
55   when: trex_extracted.changed