code: def _config(key, mandatory=True, opts=None):
      '''
      Return a value for 'name' from master config file options or defaults.
      '''
      try:
          if opts:
              value = opts['auth.ldap.{0}'.format(key)]
          else:
              value = __opts__['auth.ldap.{0}'.format(key)]
      except KeyError:
          try:
              value = __defopts__['auth.ldap.{0}'.format(key)]
          except KeyError:
              if mandatory:
                  msg = 'missing auth.ldap.{0} in master config'.format(key)
                  raise SaltInvocationError(msg)
              return False
      return valuf _config(key, mandatory=True, opts=None):
      '''
      Return a value for 'name' from master config file options or defaults.
      '''
      try:
          if opts:
              value = opts['auth.ldap.{0}'.format(key)]
          else:
              value = __opts__['auth.ldap.{0}'.format(key)]
      except KeyError:
          try:
              value = __defopts__['auth.ldap.{0}'.format(key)]
          except KeyError:
              if mandatory:
                  msg = 'missing auth.ldap.{0} in master config'.format(key)
                  raise SaltInvocationError(msg)
              return False
      return value
docs: Return a value for 'name' from master config file options or defaults.