Reorganize benchmarking tasks into ansible roles which helps to 81/33581/3
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 20 Apr 2017 12:58:13 +0000 (20:58 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Fri, 21 Apr 2017 05:43:50 +0000 (13:43 +0800)
- group task with related templates and variables
- simplify the main playbook to improve readability

See: http://docs.ansible.com/ansible/playbooks_roles.html

Change-Id: I9d3180edaac83ee9dba85ce5ac14ff574af7a905
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
24 files changed:
resources/roles/inxi/tasks/main.yml [moved from resources/metric/inxi.yaml with 100% similarity]
resources/roles/nDPI/defaults/main.yml [new file with mode: 0644]
resources/roles/nDPI/meta/main.yml [new file with mode: 0644]
resources/roles/nDPI/tasks/main.yml [moved from resources/metric/nDPI.yaml with 100% similarity]
resources/roles/openssl/tasks/main.yml [moved from resources/metric/openssl.yaml with 100% similarity]
resources/roles/qtip-workspace/defaults/main.yml [moved from resources/roles/qtip-bootstrap/defaults/main.yml with 100% similarity]
resources/roles/qtip-workspace/files/copy/fixtures/case.json [moved from resources/roles/qtip-bootstrap/files/copy/fixtures/case.json with 100% similarity]
resources/roles/qtip-workspace/files/copy/fixtures/pod.json [moved from resources/roles/qtip-bootstrap/files/copy/fixtures/pod.json with 100% similarity]
resources/roles/qtip-workspace/files/copy/fixtures/project.json [moved from resources/roles/qtip-bootstrap/files/copy/fixtures/project.json with 100% similarity]
resources/roles/qtip-workspace/files/copy/group_vars/.gitkeep [moved from resources/roles/qtip-bootstrap/files/copy/group_vars/.gitkeep with 100% similarity]
resources/roles/qtip-workspace/files/copy/host_vars/.gitkeep [moved from resources/roles/qtip-bootstrap/files/copy/host_vars/.gitkeep with 100% similarity]
resources/roles/qtip-workspace/files/copy/run.yml [moved from resources/roles/qtip-bootstrap/files/copy/run.yml with 81% similarity]
resources/roles/qtip-workspace/files/copy/setup.yml [moved from resources/roles/qtip-bootstrap/files/copy/setup.yml with 100% similarity]
resources/roles/qtip-workspace/files/copy/templates/hosts [moved from resources/roles/qtip-bootstrap/files/copy/templates/hosts with 100% similarity]
resources/roles/qtip-workspace/files/copy/templates/ssh.cfg [moved from resources/roles/qtip-bootstrap/files/copy/templates/ssh.cfg with 100% similarity]
resources/roles/qtip-workspace/files/render/ansible.cfg [moved from resources/roles/qtip-bootstrap/files/render/ansible.cfg with 100% similarity]
resources/roles/qtip-workspace/files/render/group_vars/all.yml [moved from resources/roles/qtip-bootstrap/files/render/group_vars/all.yml with 100% similarity]
resources/roles/qtip-workspace/files/render/host_vars/localhost.yml [moved from resources/roles/qtip-bootstrap/files/render/host_vars/localhost.yml with 100% similarity]
resources/roles/qtip-workspace/files/render/hosts [moved from resources/roles/qtip-bootstrap/files/render/hosts with 100% similarity]
resources/roles/qtip-workspace/tasks/main.yml [moved from resources/roles/qtip-bootstrap/tasks/main.yml with 100% similarity]
resources/roles/ramspeed/defaults/main.yml [new file with mode: 0644]
resources/roles/ramspeed/meta/main.yml [new file with mode: 0644]
resources/roles/ramspeed/tasks/main.yml [moved from resources/metric/ramspeed.yaml with 100% similarity]
tests/integration/workspace-create.yml

diff --git a/resources/roles/nDPI/defaults/main.yml b/resources/roles/nDPI/defaults/main.yml
new file mode 100644 (file)
index 0000000..d8aae81
--- /dev/null
@@ -0,0 +1,12 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+---
+nDPI_cwd: "{{ ansible_env.HOME }}/qtip/nDPI"
+nDPI_file: "dpi.pcap"
diff --git a/resources/roles/nDPI/meta/main.yml b/resources/roles/nDPI/meta/main.yml
new file mode 100644 (file)
index 0000000..03c96c4
--- /dev/null
@@ -0,0 +1,12 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+---
+dependencies:
+  - { role: development-tools }
 
   roles:
 
-    - { role: unixbench, tags: [unixbench] }
-
-  tasks:
-
-  - name: collect system information
-    include: "{{ qtip_resources }}/metric/inxi.yaml"
-
-  - name: ssl metrics
-    include: "{{ qtip_resources }}/metric/openssl.yaml"
-    tags: [ssl]
-
-  - name: DPI metrics
-    include: "{{ qtip_resources }}/metric/nDPI.yaml"
-    vars:
-      nDPI_cwd: "{{ ansible_env.HOME }}/qtip/nDPI"
-      nDPI_file: "dpi.pcap"
-    tags: [dpi]
-
-  - name: memory metrics
-    include: "{{ qtip_resources }}/metric/ramspeed.yaml"
-    vars:
-      cwd: "{{ ansible_env.HOME }}/qtip/ramspeed"
-    tags: [mem]
+    - { 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]}
 
+  post_tasks:
   - name: calculate QPI of compute
     calculate:
       metrics:
diff --git a/resources/roles/ramspeed/defaults/main.yml b/resources/roles/ramspeed/defaults/main.yml
new file mode 100644 (file)
index 0000000..0cc06cf
--- /dev/null
@@ -0,0 +1,11 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+---
+cwd: "{{ ansible_env.HOME }}/qtip/ramspeed"
diff --git a/resources/roles/ramspeed/meta/main.yml b/resources/roles/ramspeed/meta/main.yml
new file mode 100644 (file)
index 0000000..03c96c4
--- /dev/null
@@ -0,0 +1,12 @@
+#############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#############################################################################
+
+---
+dependencies:
+  - { role: development-tools }
index 71fd08d..919fe77 100644 (file)
@@ -10,7 +10,7 @@
 ---
 - hosts: localhost
   roles:
-    - role: qtip-bootstrap
+    - role: qtip-workspace
       installer: fuel         # fuel|apex
       pod_name: qtip-pod
       scenario: default