<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_role_info(self, role_name, role_type, host_id, config=None):
 """ Add a role info. The role will be created along with the service setup. @param role_name: Role name @param role_type: Role type @param host_id: The host where the role should run @param config: (Optional) A dictionary of role config values """

    if self.roles is None:
      self.roles = [ ]
    api_config_list = config is not None and config_to_api_list(config) or None
    self.roles.append({
        'name' : role_name,
        'type' : role_type,
        'hostRef' : { 'hostId' : host_id },
        'config' : api_config_list })