From e579659699b4571a69990efc5861914e4701a4f6 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sat, 22 Apr 2017 22:19:27 +0800 Subject: Unify workdir - use role variable `workdir` - download dependencies to remote workdir with checksum Change-Id: I2a7991e014e365fec532520c2b57a3fe480914d8 Signed-off-by: Yujun Zhang --- resources/ansible_roles/nDPI/tasks/main.yml | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'resources/ansible_roles/nDPI/tasks') diff --git a/resources/ansible_roles/nDPI/tasks/main.yml b/resources/ansible_roles/nDPI/tasks/main.yml index d8bee591..e8d359e5 100644 --- a/resources/ansible_roles/nDPI/tasks/main.yml +++ b/resources/ansible_roles/nDPI/tasks/main.yml @@ -7,26 +7,24 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - -- name: prepare sample pcap file - get_url: - url: "http://artifacts.opnfv.org/qtip/utilities/test.pcap" - dest: "{{ qtip_cache }}/{{ nDPI_file }}" - # validate_certs: no # required when using proxy for https - run_once: yes - delegate_to: localhost +--- - name: making nDPI temporary directory file: - path: "{{ nDPI_cwd }}" + path: "{{ workdir }}" state: directory -- name: clone nDPI - git: - repo: https://github.com/ntop/nDPI.git - dest: "{{ nDPI_cwd }}" - depth: 1 - update: no +- name: downloading nDPI + get_url: + url: https://github.com/ntop/nDPI/archive/1.6.tar.gz + dest: "{{ workdir }}" + checksum: "sha256:0863c7096f70c785e1b27a34f7b40939ac1a0e3a734ea3dcaa5cf161360a2561" + +- name: extracting nDPI + command: "tar zxf nDPI-1.6.tar.gz" + args: + chdir: "{{ workdir }}" + creates: nDPI-1.6 - name: build nDPI library command: '{{ item }}' @@ -35,23 +33,25 @@ - ./configure - make args: - chdir: "{{ nDPI_cwd }}" + chdir: "{{ workdir }}/nDPI-1.6" creates: example/ndpiReader -- name: copy sample packet file - copy: - src: "{{ qtip_cache}}/{{ nDPI_file }}" - dest: "{{ nDPI_cwd }}/example/{{ nDPI_file }}" +- name: downloading sample pcap file + get_url: + url: "https://build.opnfv.org/artifacts.opnfv.org/qtip/utilities/test.pcap" + dest: "{{ workdir }}/nDPI-1.6/example/{{ sample_pcap }}" + checksum: "sha256:ac5d1501d91a6d8a8d3bfcef6f74a87bf660cd2c2ab11b9791535aa5193e4f71" + validate_certs: no # required when using proxy for https - name: - command: "./ndpiReader -i {{ nDPI_file }}" + command: "./ndpiReader -i {{ sample_pcap }}" args: - chdir: "{{ nDPI_cwd }}/example/" - register: nDPI_out + chdir: "{{ workdir }}/nDPI-1.6/example/" + register: ndpi_out - name: collect DPI metrics from nDPI collect: - string: "{{ nDPI_out.stdout }}" + string: "{{ ndpi_out.stdout }}" patterns: # nDPI throughput: 1.46 M pps / 13.69 Gb/sec # TODO(yujunz) convert "M pps" and "K pps" to number -- cgit 1.2.3-korg