Add a judgement to control the proxy jump configuration 67/49267/3
authorzhihui wu <wu.zhihui1@zte.com.cn>
Tue, 19 Dec 2017 09:26:29 +0000 (17:26 +0800)
committerzhihui wu <wu.zhihui1@zte.com.cn>
Tue, 9 Jan 2018 09:07:47 +0000 (17:07 +0800)
- Set a default value(True) to proxy_jump
- For MCP, set proxy_jump to False. Because remote node can
be directly connected from qtip container without proxy jump.

Change-Id: I92214de984a0231ba4ba873f3a60cb12589ade28
Signed-off-by: zhihui wu <wu.zhihui1@zte.com.cn>
qtip/ansible_library/modules/mcp.py
resources/ansible_roles/qtip-generator/files/compute/templates/ssh.cfg
resources/ansible_roles/qtip/defaults/main.yml [new file with mode: 0755]

index 97ead72..43075fc 100644 (file)
@@ -80,7 +80,7 @@ def generate_inventory(nodes):
         }
         hosts['compute'].append(value['host'])
 
-    return {'hosts': hosts, 'hosts_meta': hosts_meta}
+    return {'hosts': hosts, 'hosts_meta': hosts_meta, 'proxy_jump': False}
 
 
 def main():
index 1b7c018..94acd77 100644 (file)
@@ -10,7 +10,9 @@
 Host {{ name }}
   HostName {{ host.ansible_ssh_host }}
       User {{ host.ansible_user }}
+{% if proxy_jump %}
   ProxyCommand ssh -o 'ForwardAgent yes' {{ installer_host }} 'ssh-add && nc %h %p'
+{% endif %}
 
 {% endfor %}
 {% endraw %}
\ No newline at end of file
diff --git a/resources/ansible_roles/qtip/defaults/main.yml b/resources/ansible_roles/qtip/defaults/main.yml
new file mode 100755 (executable)
index 0000000..2569059
--- /dev/null
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2018 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
+##############################################################################
+
+proxy_jump: True