def _get_host_tmpl_vars_dict(self, host_id, global_vars_dict, **kwargs):
        """Generate template variables dictionary."""
        vars_dict = {}
        if global_vars_dict:
            # Set cluster template vars_dict from cluster os_config.
            vars_dict = deepcopy(global_vars_dict)

        # Set hostname, MAC address and hostname, networks, dns and so on.
        host_baseinfo = self.config_manager.get_host_baseinfo(host_id)
        vars_dict[const.BASEINFO] = host_baseinfo

        # Set profile
        if self.PROFILE in kwargs:
            profile = kwargs[self.PROFILE]
        else:
            os_version = self.config_manager.get_os_version()
            profile = self._get_profile_from_server(os_version)

        vars_dict[const.BASEINFO][self.PROFILE] = profile

        metadata = self.config_manager.get_os_config_metadata()
        os_config = self.config_manager.get_host_os_config(host_id)

        # Get template variables values from host os_config
        host_vars_dict = self.get_tmpl_vars_from_metadata(metadata, os_config)
        util.merge_dict(
            vars_dict.setdefault(const.OS_CONFIG, {}), host_vars_dict
        )
        return vars_dict
dataset/ETHPy150Open openstack/compass-core/compass/deployment/installers/os_installers/cobbler/cobbler.py/CobblerInstaller._get_host_tmpl_vars_dict/original