code: def unpack_ext(ext_path):
      '''
      Unpack the external modules.
      '''
      modcache = os.path.join(
              OPTIONS.saltdir,
              'running_data',
              'var',
              'cache',
              'salt',
              'minion',
              'extmods')
      tfile = tarfile.TarFile.gzopen(ext_path)
      old_umask = os.umask(0o077)  # pylint: disable=blacklisted-function
      tfile.extractall(path=modcache)
      tfile.close()
      os.umask(old_umask)  # pylint: disable=blacklisted-function
      os.unlink(ext_path)
      ver_path = os.path.join(modcache, 'ext_version')
      ver_dst = os.path.join(OPTIONS.saltdir, 'ext_version')
      shutil.move(ver_path, ver_dstf unpack_ext(ext_path):
      '''
      Unpack the external modules.
      '''
      modcache = os.path.join(
              OPTIONS.saltdir,
              'running_data',
              'var',
              'cache',
              'salt',
              'minion',
              'extmods')
      tfile = tarfile.TarFile.gzopen(ext_path)
      old_umask = os.umask(0o077)  # pylint: disable=blacklisted-function
      tfile.extractall(path=modcache)
      tfile.close()
      os.umask(old_umask)  # pylint: disable=blacklisted-function
      os.unlink(ext_path)
      ver_path = os.path.join(modcache, 'ext_version')
      ver_dst = os.path.join(OPTIONS.saltdir, 'ext_version')
      shutil.move(ver_path, ver_dst)
docs: Unpack the external modules.