@salt.utils.decorators.which_bin(('unrar', 'rar'))
def unrar(rarfile, dest, excludes=None, template=None, runas=None, trim_output=False):
 if isinstance(excludes, string_types):
  excludes = [entry.strip() for entry in excludes.split(',')]
 cmd = [salt.utils.which_bin(('unrar', 'rar')), 'x', '-idp', '{0}'.format(rarfile)]
 if (excludes is not None):
  for exclude in excludes:
   cmd.extend(['-x', '{0}'.format(exclude)])
 cmd.append('{0}'.format(dest))
 files = __salt__['cmd.run'](cmd, template=template, runas=runas, python_shell=False).splitlines()
 return _trim_files(files, trim_output)

@ salt . utils . decorators . which_bin ( ( 'unrar' , 'rar' ) ) def unrar ( rarfile , dest , excludes = None , template = None , runas = None , trim_output = False ) : if isinstance ( excludes , string_types ) : excludes = [ entry . strip ( ) for entry in excludes . split ( ',' ) ] cmd = [ salt . utils . which_bin ( ( 'unrar' , 'rar' ) ) , 'x' , '-idp' , '{0}' . format ( rarfile ) ] if ( excludes is not None ) : for exclude in excludes : cmd . extend ( [ '-x' , '{0}' . format ( exclude ) ] ) cmd . append ( '{0}' . format ( dest ) ) files = __salt__ [ 'cmd.run' ] ( cmd , template = template , runas = runas , python_shell = False ) . splitlines ( ) return _trim_files ( files , trim_output )
uses rar for linux_ to unpack rar files .