hacker emblem

BluePojo

Josiah Kiehl

0 Notes

Getting started with Rake::RemoteTask

Given the docs for Rake::RemoteTask are virtually non-existent, here’s a quickstart for this simple gem for handling server tasks.

A simple task

Lets just get something working so we can see the basics.

Set up pubkey authentication with your server

For details: http://www.cyberciti.biz/faq/ssh-password-less-login-with-dsa-publickey-authentication/

If your server’s username is different than your development machine, set that properly in your .ssh/config:

Test that you’re not prompted for a password:

Back on your machine, we’re ready to fire off a test remote task.

Add rake-remote_task to your Gemfile:

Declare a target for your task, the second parameter being the role to which you assign the host: (don’t forget to require the gem)

Assuming you’ve done everything right till this point, running your task should product this output: