docs: def deploy_remote(self, dotfiles):
          """Deploy dotfiles to a remote server."""
          tempfile_path = None
          tempdir_path = None
  
          try:
              tempdir_path = tempfile.mkdtemp()
              self.log.debug('Deploying to temp dir %s', tempdir_path)
              self.deploy_local(dotfiles, target_root=tempdir_path)
  
              if self.args.rsync:
                  local_spec = tempdir_path.rstrip('/') + '/'
                  remote_spec = self.args.path.rstrip('/') + '/'
  
                  if self.args.user:
                      remote_spec = "{0}@{1}:{2}".format(self.args.user,
                                                         self.args.server,
                                                         remote_spec)
                  else:
                      remote_spec = "{0}:{1}".format(self.args.server,
                                                     remote_spec)
  
                  self.log.debug('Using rsync to sync dotfiles to %s',
                                 remote_spec)
                  self.sh('rsync', '-az', local_spec, remote_spec)
  
              else:
                  fh, tempfile_path = tempfile.mkstemp(suffix='.tar.gz')
                  os.close(fh)
  
                  self.log.debug('Creating tar file %s', tempfile_path)
                  shutil.make_archive(tempfile_path.replace('.tar.gz', ''),
                                      'gztar', tempdir_path)
  
                  upload_path = '_profile_upload.tgz'
                  self.log.debug('Uploading tarball to %s', upload_path)
                  self.scp(tempfile_path, upload_path)
  
                  if self.args.path:
                      ssh_command = "'mkdir -p {0} && "\
                                    "tar xf _profile_upload.tgz -C {0}; "\
                                    "rm -f _profile_upload.tgz'"\
                                    "".format(self.args.path)
                  else:
                      ssh_command = "tar xf _profile_upload.tgz; "\
                                    "rm -f _profile_upload.tgz"
                  self.log.debug('Using ssh to unpack tarball and clean up')
                  self.ssh(ssh_command)
  
          finally:
              if tempdir_path and path.isdir(tempdir_path):
                  self.log.debug('Removing temp dir %s', tempdir_path)
                  shutil.rmtree(tempdir_path)
              if tempfile_path and path.isfile(tempfile_path):
                  self.log.debug('Removing temp file %s', tempfile_path)
                  os.unlink(tempfile_path)