aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/trex
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2020-02-28 15:26:06 +0000
committerPeter Mikus <pmikus@cisco.com>2020-03-10 11:11:31 +0000
commit6db8aec19b0109f9efcef189d32ddaac8c469370 (patch)
tree9fc1c42a1460f3e8bff7af20fc833d2b2a2d0a11 /resources/tools/testbed-setup/ansible/roles/trex
parent6daa2d791f0e0d41b73668ef3ee233e58987dc37 (diff)
Ansible: LTS support
- There is currently no other way to support multiple version of playbooks. Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I2ade4a57d726b793e422996e83bf767ac4315488
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/trex')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml5
-rw-r--r--resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml61
2 files changed, 48 insertions, 18 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml
index 0daa913cfc..79a77bc558 100644
--- a/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml
@@ -26,4 +26,7 @@ packages_by_arch:
- []
trex_target_dir: "/opt"
-trex_version: "2.73"
+trex_url: "https://github.com/cisco-system-traffic-generator/trex-core/archive/"
+trex_version:
+ - "2.54"
+ - "2.73"
diff --git a/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml
index 11f51ddeac..d8f35cbc17 100644
--- a/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml
@@ -1,7 +1,7 @@
---
# file: roles/trex/tasks/main.yaml
-- name: T-Rex Install - Install Distribution - Release - Machine Prerequisites
+- name: T-Rex - Distribution - Release - Machine Prerequisites
package:
name: "{{ packages | flatten(levels=1) }}"
state: latest
@@ -9,52 +9,79 @@
tags:
- install-dependencies
-- name: T-Rex Install - Get Release Archive
+- name: T-Rex - 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"
+ 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 Install - Ensure Directory Exists
+- name: T-Rex - Ensure Directory Exists
file:
- path: "{{ trex_target_dir }}/trex-core-{{ trex_version }}"
+ path: "{{ trex_target_dir }}/trex-core-{{ item }}"
state: "directory"
- register: trex_dir_created
+ loop: "{{ trex_version }}"
tags:
- install-trex
-- name: T-Rex Install - Extract Release Archive
+- name: T-Rex - Extract Release Archive
unarchive:
remote_src: true
- src: "{{ trex_target_dir }}/trex-core-{{ trex_version }}.tar.gz"
+ src: "{{ trex_target_dir }}/trex-core-{{ item }}.tar.gz"
dest: "{{ trex_target_dir }}/"
- creates: "{{ trex_target_dir }}/trex-core-{{ trex_version }}/linux_dpdk/"
- when: trex_dir_created
+ creates: "{{ trex_target_dir }}/trex-core-{{ item }}/linux_dpdk/"
+ loop: "{{ trex_version }}"
register: trex_extracted
tags:
- install-trex
-- name: T-Rex Install - Azure patch I
+- name: T-Rex - Azure patch I
patch:
src: "files/t-rex.patch"
- basedir: "{{ trex_target_dir }}/trex-core-{{ trex_version }}"
+ basedir: "{{ trex_target_dir }}/trex-core-{{ item }}"
strip: 1
+ loop: "{{ trex_version }}"
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"
+- 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 Install - Compile Release II
- raw: "cd {{ trex_target_dir }}/trex-core-{{ trex_version }}/scripts/ko/src; make; make install"
+- 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