aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-24 21:14:40 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-24 22:47:18 +0800
commit7aaa7b0bf4ae4f29134b0298351c1aa1c189c253 (patch)
tree3cde7a25f4dc1500bd2c35cb54efc53d66070b0a /resources/ansible_roles
parentd550122312110e9db8759a4dc52ace8b230373db (diff)
Support running collect stage only
- add `always` tag to tasks required for all stages - apply `setup`, `collect` and `run` tag to each stage Change-Id: I806ec1add08bb18cb5b2848c78a039ed8a38c8ff Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles')
-rw-r--r--resources/ansible_roles/inxi/tasks/main.yml9
-rw-r--r--resources/ansible_roles/qtip-workspace/files/defaults/run.yml20
-rw-r--r--resources/ansible_roles/qtip/tasks/setup-local.yml15
-rw-r--r--resources/ansible_roles/qtip/tasks/setup-node.yml4
4 files changed, 33 insertions, 15 deletions
diff --git a/resources/ansible_roles/inxi/tasks/main.yml b/resources/ansible_roles/inxi/tasks/main.yml
index 6d041e3f..e7ffd18c 100644
--- a/resources/ansible_roles/inxi/tasks/main.yml
+++ b/resources/ansible_roles/inxi/tasks/main.yml
@@ -19,6 +19,8 @@
- name: generating log filename
set_fact:
logfile: "{{ qtip_results }}/inxi.log"
+ tags:
+ - always
- name: saving output to log
copy:
@@ -50,13 +52,16 @@
- '.+\sKernel:\s+(?P<kernel>.+)\sConsole'
- '.+\s+HDD Total Size:\s+(?P<disk>.+)\s'
- '.+\sproduct:\s+(?P<product>.+)\sv'
- dump: 'inix.log'
+ export_to: "{{ qtip_results }}/system_info.json"
register: system_info
delegate_to: localhost
+ tags:
+ - collect
- name: create system information report
template:
src: system-info.j2
dest: "{{ qtip_results }}/system-info"
delegate_to: localhost
- tags: [report]
+ tags:
+ - report
diff --git a/resources/ansible_roles/qtip-workspace/files/defaults/run.yml b/resources/ansible_roles/qtip-workspace/files/defaults/run.yml
index b76e4573..15b12214 100644
--- a/resources/ansible_roles/qtip-workspace/files/defaults/run.yml
+++ b/resources/ansible_roles/qtip-workspace/files/defaults/run.yml
@@ -13,33 +13,33 @@
roles:
# prepare local environment
- - { role: qtip, tasks: setup-local }
+ - { role: qtip, tasks: setup-local, tags: [setup] }
- hosts: compute
roles:
# prepare environment
- - { role: qtip, tasks: setup-node }
+ - { role: qtip, tasks: setup-node, tags: [setup] }
- hosts: compute
roles:
# run test and collect metrics
- - { role: inxi, tags: [inxi, sysinfo] }
- - { role: unixbench, tags: [unixbench, float, int] }
- - { role: openssl, tags: [openssl, ssl]}
- - { role: nDPI, tags: [ndpi, dpi]}
- - { role: ramspeed, tags: [ramspeed, mem]}
+ - { role: inxi, tags: [run, inxi, sysinfo] }
+ - { role: unixbench, tags: [run, unixbench, arithmetic] }
+ - { role: openssl, tags: [run, openssl, ssl] }
+ - { role: nDPI, tags: [run, ndpi, dpi] }
+ - { role: ramspeed, tags: [run, ramspeed, memory] }
# calculate scores
- - { role: qtip, tasks: calculate}
+ - { role: qtip, tasks: calculate, tags: [calculate] }
- hosts: localhost
roles:
# aggregate results and produce report
- - { role: qtip, tasks: aggregate }
+ - { role: qtip, tasks: aggregate, tags: [aggregate] }
# publish results
- - { role: opnfv-testapi, tasks: report, when: testapi_url is defined}
+ - { role: opnfv-testapi, tasks: report, when: testapi_url is defined, tags: [report] }
diff --git a/resources/ansible_roles/qtip/tasks/setup-local.yml b/resources/ansible_roles/qtip/tasks/setup-local.yml
index add58b3e..f5f83278 100644
--- a/resources/ansible_roles/qtip/tasks/setup-local.yml
+++ b/resources/ansible_roles/qtip/tasks/setup-local.yml
@@ -9,9 +9,20 @@
---
-- name: setting result directory name
+- name: formatting directory name for current run
set_fact:
- qtip_results_base: "{{ qtip_results }}/{{ pod_name }}-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"
+ pod_results: "{{ pod_name }}-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"
+
+- name: creating directory for current run
+ file:
+ state: directory
+ path: "{{ qtip_results }}/{{ pod_results }}"
+
+- name: creating symbolic link to current test
+ file:
+ state: link
+ src: "{{ pod_results }}"
+ dest: "{{ qtip_results }}/current"
- name: create cache directory
file:
diff --git a/resources/ansible_roles/qtip/tasks/setup-node.yml b/resources/ansible_roles/qtip/tasks/setup-node.yml
index 92ee66bc..af848f70 100644
--- a/resources/ansible_roles/qtip/tasks/setup-node.yml
+++ b/resources/ansible_roles/qtip/tasks/setup-node.yml
@@ -11,7 +11,9 @@
- name: overriding result directory name
set_fact:
- qtip_results: "{{ hostvars['localhost']['qtip_results_base']}}/{{ inventory_hostname }}"
+ qtip_results: "{{ qtip_results }}/current/{{ inventory_hostname }}"
+ tags:
+ - always
- name: creating result directory
file: