From 0a913095a0888f4653e32150f6ffd9cb6a9e01ee Mon Sep 17 00:00:00 2001 From: zhihui wu Date: Tue, 19 Dec 2017 16:27:50 +0800 Subject: fix some bugs about mcp module - ansible user should be "ubuntu" - SUT:children is "compute" not "compute-nodes" in the template/hosts - logical error about node_meta - Uniform installer_group mcp value Change-Id: I8c40accbe2b5d65d93044faebaf166703ab63932 Signed-off-by: zhihui wu --- qtip/ansible_library/modules/mcp.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'qtip/ansible_library/modules/mcp.py') diff --git a/qtip/ansible_library/modules/mcp.py b/qtip/ansible_library/modules/mcp.py index 21be7bcc..97ead724 100644 --- a/qtip/ansible_library/modules/mcp.py +++ b/qtip/ansible_library/modules/mcp.py @@ -72,16 +72,13 @@ def generate_inventory(nodes): """Generate ansible inventory from node list in json format""" hosts = defaultdict(list) hosts_meta = {} - node_meta = {} for key, value in nodes.iteritems(): - if isinstance(value, dict): - for k, v in value.iteritems(): - if k == "fqdn_ip4": - node_meta['ansible_ssh_host'] = v[0] - node_meta['ansible_user'] = 'root' - hosts_meta[key] = node_meta - hosts['compute-nodes'].append(node_meta['ansible_ssh_host']) + hosts_meta[value['host']] = { + 'ansible_ssh_host': value['fqdn_ip4'][0], + 'ansible_user': 'ubuntu' + } + hosts['compute'].append(value['host']) return {'hosts': hosts, 'hosts_meta': hosts_meta} -- cgit 1.2.3-korg