diff options
author | Peter Mikus <pmikus@cisco.com> | 2019-09-10 08:09:43 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-09-11 10:54:32 +0000 |
commit | 891f932d2c0928038c7cb77f96ecad6e12c0e81f (patch) | |
tree | 706a3867e582b0a1f0b1436c94a6da4e1eb7f315 /resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml | |
parent | 27cff25483728d50e0215b895c680fb88f6ffe99 (diff) |
Ansible: Trex installation
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I5ab8fe05074a842301a511bbd3ab5e67f8d1a9f0
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml')
-rw-r--r-- | resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml new file mode 100644 index 0000000000..3cfcbea825 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml @@ -0,0 +1,40 @@ +--- +# file: roles/tg/tasks/trex.yaml + +- name: Download TRex release archive + get_url: + url: '{{ trex.url }}/v{{ trex.version }}.tar.gz' + dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' + mode: 0644 + register: 'linux__trex_downloaded' + tags: install-trex + +- name: Ensure TRex directory exists + file: + path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}' + state: 'directory' + register: 'linux__trex_dir_created' + tags: install-trex + +- name: Extract TRex release archive + become: yes + unarchive: + src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' + dest: '{{ trex.target_dir }}/' + creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk' + remote_src: yes + when: 'linux__trex_dir_created' + register: 'linux__trex_extracted' + tags: install-trex + +- name: Compile TRex release I + become: yes + shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build' + when: 'linux__trex_extracted' + tags: install-trex + +- name: Compile TRex release II + become: yes + shell: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install' + when: 'linux__trex_extracted' + tags: install-trex |