def config_set(key, value=None, multivar=None, cwd=None, user=None, password=None, ignore_retcode=False, **kwargs):
 kwargs = salt.utils.clean_kwargs(**kwargs)
 add_ = kwargs.pop('add', False)
 global_ = kwargs.pop('global', False)
 if kwargs:
  salt.utils.invalid_kwargs(kwargs)
 if (cwd is None):
  if (not global_):
   raise SaltInvocationError("'cwd' argument required unless global=True")
 else:
  cwd = _expand_path(cwd, user)
 if all(((x is not None) for x in (value, multivar))):
  raise SaltInvocationError("Only one of 'value' and 'multivar' is permitted")
 if (value is not None):
  if (not isinstance(value, six.string_types)):
   value = str(value)
 if (multivar is not None):
  if (not isinstance(multivar, list)):
   try:
    multivar = multivar.split(',')
   except AttributeError:
    multivar = str(multivar).split(',')
  else:
   new_multivar = []
   for item in multivar:
    if isinstance(item, six.string_types):
     new_multivar.append(item)
    else:
     new_multivar.append(str(item))
   multivar = new_multivar
 command_prefix = ['git', 'config']
 if global_:
  command_prefix.append('--global')
 if (value is not None):
  command = copy.copy(command_prefix)
  if add_:
   command.append('--add')
  else:
   command.append('--replace-all')
  command.extend([key, value])
  _git_run(command, cwd=cwd, user=user, password=password, ignore_retcode=ignore_retcode)
 else:
  for (idx, target) in enumerate(multivar):
   command = copy.copy(command_prefix)
   if (idx == 0):
    command.append('--replace-all')
   else:
    command.append('--add')
   command.extend([key, target])
   _git_run(command, cwd=cwd, user=user, password=password, ignore_retcode=ignore_retcode)
 return config_get(key, user=user, password=password, cwd=cwd, ignore_retcode=ignore_retcode, **{'all': True, 'global': global_})

def config_set ( key , value = None , multivar = None , cwd = None , user = None , password = None , ignore_retcode = False , ** kwargs ) : kwargs = salt . utils . clean_kwargs ( ** kwargs ) add_ = kwargs . pop ( 'add' , False ) global_ = kwargs . pop ( 'global' , False ) if kwargs : salt . utils . invalid_kwargs ( kwargs ) if ( cwd is None ) : if ( not global_ ) : raise SaltInvocationError ( "'cwd' argument required unless global=True" ) else : cwd = _expand_path ( cwd , user ) if all ( ( ( x is not None ) for x in ( value , multivar ) ) ) : raise SaltInvocationError ( "Only one of 'value' and 'multivar' is permitted" ) if ( value is not None ) : if ( not isinstance ( value , six . string_types ) ) : value = str ( value ) if ( multivar is not None ) : if ( not isinstance ( multivar , list ) ) : try : multivar = multivar . split ( ',' ) except AttributeError : multivar = str ( multivar ) . split ( ',' ) else : new_multivar = [ ] for item in multivar : if isinstance ( item , six . string_types ) : new_multivar . append ( item ) else : new_multivar . append ( str ( item ) ) multivar = new_multivar command_prefix = [ 'git' , 'config' ] if global_ : command_prefix . append ( '--global' ) if ( value is not None ) : command = copy . copy ( command_prefix ) if add_ : command . append ( '--add' ) else : command . append ( '--replace-all' ) command . extend ( [ key , value ] ) _git_run ( command , cwd = cwd , user = user , password = password , ignore_retcode = ignore_retcode ) else : for ( idx , target ) in enumerate ( multivar ) : command = copy . copy ( command_prefix ) if ( idx == 0 ) : command . append ( '--replace-all' ) else : command . append ( '--add' ) command . extend ( [ key , target ] ) _git_run ( command , cwd = cwd , user = user , password = password , ignore_retcode = ignore_retcode ) return config_get ( key , user = user , password = password , cwd = cwd , ignore_retcode = ignore_retcode , ** { 'all' : True , 'global' : global_ } )
set redis server configuration values cli example: .