diff options
-rw-r--r-- | qtip/ansible_library/modules/mcp.py | 13 | ||||
-rw-r--r-- | resources/ansible_roles/qtip-generator/defaults/main.yml | 2 |
2 files changed, 6 insertions, 9 deletions
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} diff --git a/resources/ansible_roles/qtip-generator/defaults/main.yml b/resources/ansible_roles/qtip-generator/defaults/main.yml index f6714b8d..344feb54 100644 --- a/resources/ansible_roles/qtip-generator/defaults/main.yml +++ b/resources/ansible_roles/qtip-generator/defaults/main.yml @@ -14,7 +14,7 @@ installer_group: manual: dummy-group fuel: fuel-masters apex: apex-underclouds - mcp: salt-masters + mcp: salt-master project_name: 'qtip-project' project_template: 'compute' |