Our Capistrano tasks that deal with root's keys.

=== scalr.rb ===

Capistrano::Configuration.instance(:must_exist).load do

  set :scalr_user_code, '/usr/local/aws/user'

  namespace :scalr do

    desc "Upload custom event handler for hostup"
    task :on_hostup, :roles => [:app,:web,:db] do
      #When role scales roots ssh environment gets deleted which
interferes with ruby based cap operations"
      upload "config/git/git_rsa", "/root/.ssh/id_rsa"
      run "chmod 600 /root/.ssh/id_rsa"
      run "mkdir -p #{scalr_user_code}/resources/ssh"
      run "cp ~/.profile  #{scalr_user_code}/resources/profile"
      run "cp -r ~/.ssh/* #{scalr_user_code}/resources/ssh/"
      run "rm -rf #{scalr_user_code}/resources/ssh/authorized_keys"
#authorized_keys is generated per farm.
      upload "templates/scalr/user/bin/hostup", "#{scalr_user_code}/
bin/hostup", :mode => "755"
      run "#{scalr_user_code}/bin/hostup"
    end

=== end ===

=== templates/scalr/usr/bin/hostup ===

#!/bin/bash
. /etc/aws/host.conf
user_resources='/usr/local/aws/user/resources'
mkdir -p /root/.ssh
cp  $user_resources/profile /root/.profile
cp -r $user_resources/ssh/* /root/.ssh/

=== end ===
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"scalr-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/scalr-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to