Kubenretes node role added to inventory.
[ta/config-manager.git] / cmframework / src / cmframework / utils / cmansibleinventory.py
index 8757426..a940f78 100644 (file)
@@ -79,6 +79,10 @@ class AnsibleInventory(object):
         hostvars[node]['nodetype'] = hostsconf.get_nodetype(node)
         hostvars[node]['nodeindex'] = hostsconf.get_nodeindex(node)
         hostvars[node]['nodename'] = hostsconf.get_nodename(node)
+        if hostsconf.get_nodetype(node) == "caas-master":
+            hostvars[node]['noderole'] = "master"
+        elif hostsconf.get_nodetype(node) == "caas-worker":
+            hostvars[node]['noderole'] = "worker"
 
         host_labels = hostsconf.get_labels(node)
         if host_labels:
@@ -237,7 +241,7 @@ class AnsibleInventory(object):
             plugins = self.pluginloader.get_plugin_instances(self.confman, inventory, ownhost)
             if self._is_setup():
                 inventory.clear()
-            for name, plugin in plugins.iteritems():
+            for name, plugin in sorted(plugins.iteritems()):
                 if self._is_bootstrapping():
                     plugin.handle_bootstrapping()
                 elif self._is_provisioning():