aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml
blob: 11f51ddeac81494258748a2300c6e726e74ad3e8 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
# file: roles/trex/tasks/main.yaml

- name: T-Rex Install - Install Distribution - Release - Machine Prerequisites
  package:
    name: "{{ packages | flatten(levels=1) }}"
    state: latest
    update_cache: true
  tags:
    - install-dependencies

- 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 - Azure patch I
  patch:
    src: "files/t-rex.patch"
    basedir: "{{ trex_target_dir }}/trex-core-{{ trex_version }}"
    strip: 1
  when:
    - azure is defined
  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