aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml
blob: 163044de43a0a5482d4090591177adc98725d4e7 (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
---
# file: roles/wrk/tasks/main.yaml

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

- name: WRK - Get Release Archive
  get_url:
    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 - Extract Release Archive
  unarchive:
    remote_src: true
    src: "{{ wrk_target_dir }}/wrk-{{ item }}.tar.gz"
    dest: "{{ wrk_target_dir }}/"
    creates: "{{ wrk_target_dir }}/wrk-{{ item }}/src"
  loop: "{{ wrk_version }}"
  register: wrk_extracted
  tags:
    - install-wrk

- name: WRK - Compile Release I
  command: "make"
  args:
    chdir: "{{ wrk_target_dir }}/wrk-{{ item }}"
  loop: "{{ wrk_version }}"
  when: wrk_extracted
  register: wrk_compiled
  tags:
    - install-wrk

- name: WRK - Copy Binary
  command: "cp {{ wrk_target_dir }}/wrk-{{ item }}/wrk /usr/local/bin/"
  loop: "{{ wrk_version }}"
  when: wrk_compiled
  tags:
    - install-wrk