aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml
blob: dc86ec3e5b1a074faef3da780c1b1bdd9842c88c (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
---
# 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
  raw: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build'
  when: trex_extracted
  tags: install-trex

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