In [ ]:
%x(ssh-keygen -b 2048 -t rsa -f /tmp/sshkey -q -N "")
In [ ]:
require 'xp5k'
myxp = XP5K::XP.new
myxp.define_job({
:resources => ["nodes=1, walltime=1:00:00"],
:site => 'lyon',
:types => ["deploy"],
:name => "iruby notebook" ,
:roles => [XP5K::Role.new({:name => 'mynode', :size => 1})],
:command => "sleep 86400"
})
myxp.define_deployment({
:site => 'lyon',
:environment => "jessie-x64-nfs",
:roles => %w{ mynode },
:key => File.read("/tmp/sshkey.pub")
})
In [ ]:
myxp.submit
myxp.wait_for_jobs
myxp.deploy
In [ ]:
require 'xp5k/rake'
h = on roles('mynode'), {:user => 'root', :ssh => {:keys => ['/tmp/sshkey']}} do
cmd = ['uptime -s']
end
In [ ]:
myxp.clean
In [ ]: