aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/qtip-generator/files/compute/templates
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-24 19:57:27 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-05-25 15:43:53 +0800
commit8e0b0132a11dc94415054793d7b74215a75ac2d8 (patch)
tree2d7d71f87bf322f2d8088222724c0b1cd052dc6f /resources/ansible_roles/qtip-generator/files/compute/templates
parent00d8896a9b19ac063f31d117c0d04ccc542eeec4 (diff)
Add support for create new project from different templates
Change-Id: Ic260c59b12eb9882406d6172311f2e401963c64b Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/qtip-generator/files/compute/templates')
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/templates/hosts25
-rw-r--r--resources/ansible_roles/qtip-generator/files/compute/templates/ssh.cfg16
2 files changed, 41 insertions, 0 deletions
diff --git a/resources/ansible_roles/qtip-generator/files/compute/templates/hosts b/resources/ansible_roles/qtip-generator/files/compute/templates/hosts
new file mode 100644
index 00000000..34e4aa92
--- /dev/null
+++ b/resources/ansible_roles/qtip-generator/files/compute/templates/hosts
@@ -0,0 +1,25 @@
+{% raw %}
+localhost ansible_connection=local
+
+[{{ installer_master_group[installer] }}]
+{{ installer_master_host }}
+
+[SUT:children] # system under test
+compute
+
+[node-groups:children]
+{% for group in hosts|sort %}
+{{ group }}
+{% endfor %}
+
+[node-groups:vars]
+ansible_ssh_common_args=-F ./ssh.cfg
+
+{% for group in hosts|sort %}
+[{{ group }}]
+{% for host in hosts[group]|sort %}
+{{ host }}
+{% endfor %}
+
+{% endfor %}
+{% endraw %}
diff --git a/resources/ansible_roles/qtip-generator/files/compute/templates/ssh.cfg b/resources/ansible_roles/qtip-generator/files/compute/templates/ssh.cfg
new file mode 100644
index 00000000..67246054
--- /dev/null
+++ b/resources/ansible_roles/qtip-generator/files/compute/templates/ssh.cfg
@@ -0,0 +1,16 @@
+{% raw %}
+# Connect to target node through jump host
+#
+# OpenSSH 7.3:
+# ProxyJump jumphost
+# before OpenSSH 7.3
+# ProxyCommand ssh -o 'ForwardAgent yes' jumphost 'ssh-add && nc %h %p'
+
+{% for (name, host) in hosts_meta.items() %}
+Host {{ name }}
+ HostName {{ host.ansible_ssh_host }}
+ User root
+ ProxyCommand ssh -o 'ForwardAgent yes' {{ installer_master_host }} 'ssh-add && nc %h %p'
+
+{% endfor %}
+{% endraw %} \ No newline at end of file