diff options
author | 2020-02-28 15:26:06 +0000 | |
---|---|---|
committer | 2020-03-10 11:11:31 +0000 | |
commit | 6db8aec19b0109f9efcef189d32ddaac8c469370 (patch) | |
tree | 9fc1c42a1460f3e8bff7af20fc833d2b2a2d0a11 /resources/tools/testbed-setup/ansible/roles/wrk | |
parent | 6daa2d791f0e0d41b73668ef3ee233e58987dc37 (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/wrk')
-rw-r--r-- | resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml | 3 | ||||
-rw-r--r-- | resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml | 35 |
2 files changed, 17 insertions, 21 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml index d40ea6a9ce..2d378487df 100644 --- a/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml @@ -17,4 +17,5 @@ packages_by_arch: - [] wrk_target_dir: "/opt" -wrk_version: "4.0.2" +wrk_version: + - "4.0.2" diff --git a/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml index c2e42aa3f1..163044de43 100644 --- a/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml @@ -1,7 +1,7 @@ --- # file: roles/wrk/tasks/main.yaml -- name: WRK Install - Install Distribution - Release - Machine Prerequisites +- name: WRK - Install Distribution - Release - Machine Prerequisites package: name: "{{ packages | flatten(levels=1) }}" state: latest @@ -9,45 +9,40 @@ tags: - install-dependencies -- name: WRK Install - Get Release Archive +- name: WRK - Get Release Archive get_url: - url: "https://github.com/wg/wrk/archive/{{ wrk_version }}.tar.gz" - dest: "{{ wrk_target_dir }}/{{ wrk_version }}.tar.gz" + url: "https://github.com/wg/wrk/archive/{{ item }}.tar.gz" + dest: "{{ wrk_target_dir }}/wrk-{{ item }}.tar.gz" mode: 0644 + loop: "{{ wrk_version }}" register: wrk_downloaded tags: - install-wrk -- name: WRK Install - Ensure Directory Exists - file: - path: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}" - state: "directory" - register: wrk_dir_created - tags: - - install-wrk - -- name: WRK Install - Extract Release Archive +- name: WRK - Extract Release Archive unarchive: remote_src: true - src: "{{ wrk_target_dir }}/{{ wrk_version }}.tar.gz" + src: "{{ wrk_target_dir }}/wrk-{{ item }}.tar.gz" dest: "{{ wrk_target_dir }}/" - creates: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}/src" - when: wrk_dir_created + creates: "{{ wrk_target_dir }}/wrk-{{ item }}/src" + loop: "{{ wrk_version }}" register: wrk_extracted tags: - install-wrk -- name: WRK Install - Compile Release +- name: WRK - Compile Release I command: "make" args: - chdir: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}" + chdir: "{{ wrk_target_dir }}/wrk-{{ item }}" + loop: "{{ wrk_version }}" when: wrk_extracted register: wrk_compiled tags: - install-wrk -- name: WRK Install - Copy Binary - command: "cp {{ wrk_target_dir }}/wrk-{{ wrk_version }}/wrk /usr/local/bin/" +- name: WRK - Copy Binary + command: "cp {{ wrk_target_dir }}/wrk-{{ item }}/wrk /usr/local/bin/" + loop: "{{ wrk_version }}" when: wrk_compiled tags: - install-wrk |