aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml
blob: 3cfcbea8259dd2717e2a5d1b2764502165d265f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
# file: roles/tg/tasks/trex.yaml

- name: Download TRex release archive
  get_url:
    url: '{{ trex.url }}/v{{ trex.version }}.tar.gz'
    dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
    mode: 0644
  register: 'linux__trex_downloaded'
  tags: install-trex

- name: Ensure TRex directory exists
  file:
    path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}'
    state: 'directory'
  register: 'linux__trex_dir_created'
  tags: install-trex

- name: Extract TRex release archive
  become: yes
  unarchive:
    src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
    dest: '{{ trex.target_dir }}/'
    creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk'
    remote_src: yes
  when: 'linux__trex_dir_created'
  register: 'linux__trex_extracted'
  tags: install-trex

- name: Compile TRex release I
  become: yes
  shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build'
  when: 'linux__trex_extracted'
  tags: install-trex

- name: Compile TRex release II
  become: yes
  shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install'
  when: 'linux__trex_extracted'
  tags: install-trex