3cfcbea8259dd2717e2a5d1b2764502165d265f0
[csit.git] / resources / tools / testbed-setup / ansible / roles / tg / tasks / trex.yaml
1 ---
2 # file: roles/tg/tasks/trex.yaml
3
4 - name: Download TRex release archive
5   get_url:
6     url: '{{ trex.url }}/v{{ trex.version }}.tar.gz'
7     dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
8     mode: 0644
9   register: 'linux__trex_downloaded'
10   tags: install-trex
11
12 - name: Ensure TRex directory exists
13   file:
14     path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}'
15     state: 'directory'
16   register: 'linux__trex_dir_created'
17   tags: install-trex
18
19 - name: Extract TRex release archive
20   become: yes
21   unarchive:
22     src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
23     dest: '{{ trex.target_dir }}/'
24     creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk'
25     remote_src: yes
26   when: 'linux__trex_dir_created'
27   register: 'linux__trex_extracted'
28   tags: install-trex
29
30 - name: Compile TRex release I
31   become: yes
32   shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build'
33   when: 'linux__trex_extracted'
34   tags: install-trex
35
36 - name: Compile TRex release II
37   become: yes
38   shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install'
39   when: 'linux__trex_extracted'
40   tags: install-trex