if dump is not None:
root = task_vars.get('qtip_results', 'results')
base = task_vars.get('dump_base', 'dump')
- dump_facts(task_vars['inventory_hostname'], [{'name': dump, 'content': string}], root, base)
+ dump_facts([{'name': dump, 'content': string}], root, base)
return collect(patterns, string)
return captured
-def dump_facts(hostname, facts, root, base):
- dest = os.path.join(root, hostname, base)
+def dump_facts(facts, root, base):
+ dest = os.path.join(root, base)
if not os.path.exists(dest):
os.makedirs(dest)
return [{'name': fact['name'], 'result': open(os.path.join(dest, fact['name']), 'w+').write(fact['content'])}
- name: create system information report
template:
src: system-info.j2
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/system-info"
+ dest: "{{ qtip_results }}/system-info"
delegate_to: localhost
tags: [report]
- name: create dpi report
template:
src: dpi-metrics.j2
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/dpi-metrics"
+ dest: "{{ qtip_results }}/dpi-metrics"
delegate_to: localhost
tags: [report]
- name: create SSL report
template:
src: ssl-metrics.j2
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/ssl-metrics"
+ dest: "{{ qtip_results }}/ssl-metrics"
delegate_to: localhost
tags: [report]
# - test condition
# - performance metrics
+- hosts: localhost
+ tasks:
+ - name: setting result directory name
+ set_fact:
+ qtip_results_base: "{{ qtip_results }}/{{ pod_name }}-{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}"
+
- hosts: compute
pre_tasks:
- name: check ssh connection
ping:
+ - name: overriding result directory name
+ set_fact:
+ qtip_results: "{{ hostvars['localhost']['qtip_results_base']}}/{{ inventory_hostname }}"
+
- name: create result directory
file:
- path: "{{ qtip_results }}/{{ inventory_hostname }}"
+ path: "{{ qtip_results }}"
state: directory
delegate_to: localhost
- name: create memory metrics report
template:
src: "memory-metrics.j2"
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/memory-metrics"
+ dest: "{{ qtip_results }}/memory-metrics"
delegate_to: localhost
tags: [report]
synchronize:
mode: pull
src: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench/results/"
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/unixbench"
+ dest: "{{ qtip_results }}/unixbench"
use_ssh_args: yes
- name: create integer and floating point report
template:
src: "{{ item }}.j2"
- dest: "{{ qtip_results }}/{{ inventory_hostname }}/{{ item }}"
+ dest: "{{ qtip_results }}/{{ item }}"
with_items:
- floating-point
- integer