docs: def _update_discovery_config(opts):
      '''
      Update discovery config for all instances.
  
      :param opts:
      :return:
      '''
      if opts.get('discovery') not in (None, False):
          if opts['discovery'] is True:
              opts['discovery'] = {}
          discovery_config = {'attempts': 3, 'pause': 5, 'port': 4520, 'match': 'any', 'mapping': {}, 'multimaster': False}
          for key in opts['discovery']:
              if key not in discovery_config:
                  raise salt.exceptions.SaltConfigurationError('Unknown discovery option: {0}'.format(key))
          if opts.get('__role') != 'minion':
              for key in ['attempts', 'pause', 'match']:
                  del discovery_config[key]
          opts['discovery'] = salt.utils.dictupdate.update(discovery_config, opts['discovery'], True, True)