aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-08-14 12:30:06 +0000
committerDave Wallace <dwallacelf@gmail.com>2019-08-14 14:32:02 +0000
commit37a9451377f7239365b5af778b8072d1585a2d2a (patch)
tree2e413a56bf65012245c46efc950e97515bce74fd /resources/tools/testbed-setup/ansible/roles/tg
parentbe39339d5bf121d718623885d05848e50d466347 (diff)
Move: WRK installation into ansible
- Remove ability to install from framework. - Control via ansible with other dependencies. Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I5fd0ca18b4f76c30b6c28b4dcd15e538e01cb315
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml4
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml1
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml33
3 files changed, 38 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
index f3f5d85aa1..24f433f9b9 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml
@@ -3,3 +3,7 @@
- name: Install distribution - release - machine prerequisites
include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+
+- name: Install WRK
+ include_tasks: 'wrk.yaml'
+ tags: install-wrk
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
index 27b8b7248e..95a47b0917 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml
@@ -5,6 +5,7 @@
apt:
name:
- 'unzip'
+ - 'libssl-dev'
state: 'present'
install_recommends: False
tags: install-csit-dependencies
diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml
new file mode 100644
index 0000000000..1da45fb4b4
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml
@@ -0,0 +1,33 @@
+---
+# file: roles/tg/tasks/wrk.yaml
+
+- name: Download WRK release archive
+ get_url:
+ url: '{{ wrk.url }}/{{ wrk.version }}.tar.gz'
+ dest: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz'
+ mode: 0644
+ register: 'linux__wrk_downloaded'
+ tags: install-wrk
+
+- name: Extract WRK release archive
+ become: yes
+ unarchive:
+ src: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz'
+ dest: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}'
+ remote_src: yes
+ when: 'linux__wrk_downloaded'
+ register: 'linux__wrk_extracted'
+ tags: install-wrk
+
+- name: Compile WRK release
+ become: yes
+ shell: 'cd {{ wrk.target_dir }}/wrk-{{ wrk.version }}; make'
+ when: 'linux__wrk_extracted'
+ register: 'linux__wrk_compiled'
+ tags: install-wrk
+
+- name: Move WRK binary
+ become: yes
+ command: 'mv {{ wrk.target_dir }}/wrk-{{ wrk.version }}/wrk /usr/local/bin/'
+ when: 'linux__wrk_compiled'
+ tags: install-wrk