aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml
blob: 03f7d6da53672191ac8902553e8e9f538504b7e2 (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
41
---
# file: roles/tg/tasks/trex.yaml

- name: T-Rex Install - Get Release Archive
  get_url:
    url: 'https://github.com/cisco-system-traffic-generator/trex-core/archive/v{{ trex.version }}.tar.gz'
    dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
    mode: 0644
  register: trex_downloaded
  tags: install-trex

- name: T-Rex Install - Ensure Directory Exists
  file:
    path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}'
    state: 'directory'
  register: trex_dir_created
  tags: install-trex

- name: T-Rex Install - Extract Release Archive
  unarchive:
    remote_src: true
    src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz'
    dest: '{{ trex.target_dir }}/'
    creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/'
  when: trex_dir_created
  register: trex_extracted
  tags: install-trex

- name: T-Rex Install - Compile Release I
  command: './b configure; ./b build'
  args:
    chdir: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/'
  when: trex_extracted
  tags: install-trex

- name: T-Rex Install - Compile Release II
  command: 'make; make install'
  args:
    chdir: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src'
  when: trex_extracted
  tags: install-trex