aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml
blob: d8f35cbc1729de11b5bfdf5a22d3462379ef76cd (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
# file: roles/trex/tasks/main.yaml

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

- name: T-Rex - Get Release Archive
  get_url:
    url: "{{ trex_url }}/v{{ item }}.tar.gz"
    dest: "{{ trex_target_dir }}/trex-core-{{ item }}.tar.gz"
    validate_certs: False
    mode: 0644
  loop: "{{ trex_version }}"
  register: trex_downloaded
  tags:
    - install-trex

- name: T-Rex - Ensure Directory Exists
  file:
    path: "{{ trex_target_dir }}/trex-core-{{ item }}"
    state: "directory"
  loop: "{{ trex_version }}"
  tags:
    - install-trex

- name: T-Rex - Extract Release Archive
  unarchive:
    remote_src: true
    src: "{{ trex_target_dir }}/trex-core-{{ item }}.tar.gz"
    dest: "{{ trex_target_dir }}/"
    creates: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
  loop: "{{ trex_version }}"
  register: trex_extracted
  tags:
    - install-trex

- name: T-Rex - Azure patch I
  patch:
    src: "files/t-rex.patch"
    basedir: "{{ trex_target_dir }}/trex-core-{{ item }}"
    strip: 1
  loop: "{{ trex_version }}"
  when:
    - azure is defined
  tags:
    - install-trex

- name: T-Rex - Compile Release I
  command: "./b configure"
  args:
      chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
  loop: "{{ trex_version }}"
  when: trex_extracted
  tags:
    - install-trex

- name: T-Rex - Compile Release II
  command: "./b build"
  args:
      chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
  loop: "{{ trex_version }}"
  when: trex_extracted
  tags:
    - install-trex

- name: T-Rex - Compile Release III
  command: "make"
  args:
      chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/scripts/ko/src"
  loop: "{{ trex_version }}"
  when: trex_extracted
  tags:
    - install-trex

- name: T-Rex - Compile Release IV
  command: "make install"
  args:
      chdir: "{{ trex_target_dir }}/trex-core-{{ item }}/scripts/ko/src"
  loop: "{{ trex_version }}"
  when: trex_extracted
  tags:
    - install-trex