Merge workspace template into one directory 99/34399/1
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Sat, 6 May 2017 11:23:09 +0000 (19:23 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Sat, 6 May 2017 11:24:17 +0000 (19:24 +0800)
Change-Id: I384ea3611e58feb7292840d672094d49bb9e7482
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
15 files changed:
resources/ansible_roles/qtip-workspace/files/defaults/group_vars/.gitkeep [deleted file]
resources/ansible_roles/qtip-workspace/files/defaults/host_vars/.gitkeep [deleted file]
resources/ansible_roles/qtip-workspace/files/template/ansible.cfg [moved from resources/ansible_roles/qtip-workspace/files/custom/ansible.cfg with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/fixtures/case.json [moved from resources/ansible_roles/qtip-workspace/files/defaults/fixtures/case.json with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/fixtures/pod.json [moved from resources/ansible_roles/qtip-workspace/files/defaults/fixtures/pod.json with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/fixtures/project.json [moved from resources/ansible_roles/qtip-workspace/files/defaults/fixtures/project.json with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/group_vars/all.yml [moved from resources/ansible_roles/qtip-workspace/files/custom/group_vars/all.yml with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/host_vars/localhost.yml [moved from resources/ansible_roles/qtip-workspace/files/custom/host_vars/localhost.yml with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/hosts [moved from resources/ansible_roles/qtip-workspace/files/custom/hosts with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/run.yml [moved from resources/ansible_roles/qtip-workspace/files/defaults/run.yml with 65% similarity]
resources/ansible_roles/qtip-workspace/files/template/setup.yml [moved from resources/ansible_roles/qtip-workspace/files/defaults/setup.yml with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/teardown.yml [moved from resources/ansible_roles/qtip-workspace/files/defaults/teardown.yml with 100% similarity]
resources/ansible_roles/qtip-workspace/files/template/templates/hosts [moved from resources/ansible_roles/qtip-workspace/files/defaults/templates/hosts with 94% similarity]
resources/ansible_roles/qtip-workspace/files/template/templates/ssh.cfg [moved from resources/ansible_roles/qtip-workspace/files/defaults/templates/ssh.cfg with 94% similarity]
resources/ansible_roles/qtip-workspace/tasks/main.yml

diff --git a/resources/ansible_roles/qtip-workspace/files/defaults/group_vars/.gitkeep b/resources/ansible_roles/qtip-workspace/files/defaults/group_vars/.gitkeep
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/resources/ansible_roles/qtip-workspace/files/defaults/host_vars/.gitkeep b/resources/ansible_roles/qtip-workspace/files/defaults/host_vars/.gitkeep
deleted file mode 100644 (file)
index e69de29..0000000
 
   roles:
   # run test and collect metrics
-    - { role: inxi, output: "{{ qtip_results }}/sysinfo", tags: [run, inxi, sysinfo] }
-    - { role: unixbench, output: "{{ qtip_results }}/arithmetic", tags: [run, unixbench, arithmetic] }
-    - { role: openssl, output: "{{ qtip_results }}/ssl", tags: [run, openssl, ssl] }
-    - { role: nDPI, output: "{{ qtip_results }}/dpi", tags: [run, ndpi, dpi] }
-    - { role: ramspeed, output: "{{ qtip_results }}/memory", tags: [run, ramspeed, memory] }
+    - { role: inxi, output: "{% raw %}{{ qtip_results }}{% endraw %}/sysinfo", tags: [run, inxi, sysinfo] }
+    - { role: unixbench, output: "{% raw %}{{ qtip_results }}{% endraw %}/arithmetic", tags: [run, unixbench, arithmetic] }
+    - { role: openssl, output: "{% raw %}{{ qtip_results }}{% endraw %}/ssl", tags: [run, openssl, ssl] }
+    - { role: nDPI, output: "{% raw %}{{ qtip_results }}{% endraw %}/dpi", tags: [run, ndpi, dpi] }
+    - { role: ramspeed, output: "{% raw %}{{ qtip_results }}{% endraw %}/memory", tags: [run, ramspeed, memory] }
   # calculate scores
     - { role: qtip, tasks: calculate, tags: [calculate] }
 
@@ -1,3 +1,4 @@
+{% raw %}
 localhost   ansible_connection=local
 
 [{{ installer_master_group[installer] }}]
@@ -18,3 +19,4 @@ ansible_ssh_common_args=-F ./ssh.cfg
 {% endfor %}
 
 {% endfor %}
+{% endraw %}
\ No newline at end of file
@@ -1,3 +1,4 @@
+{% raw %}
 # Connect to target node through jump host
 #
 # OpenSSH 7.3:
@@ -12,3 +13,4 @@ Host {{ name }}
   ProxyCommand ssh -o 'ForwardAgent yes' {{ installer_master_host }} 'ssh-add && nc %h %p'
 
 {% endfor %}
+{% endraw %}
\ No newline at end of file
index 89ce3dd..4331468 100644 (file)
@@ -7,15 +7,18 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-- name: copying default files
-  synchronize:
-    src:  defaults/
-    dest: "{{ workspace }}/"
+- name: creating directories
+  file:
+    path: "{{ workspace }}/{{ item.path }}"
+    state: directory
+    force: yes
+  with_filetree: template/
+  when: item.state == 'directory'
 
-- name: customizing for workspace
+- name: templating files
   template:
     src: "{{ item.src }}"
     dest: "{{ workspace }}/{{ item.path }}"
     force: yes
-  with_filetree: custom
+  with_filetree: template/
   when: item.state == 'file'