Sha256: 508929f6b1421fffab25c28a53804480322d0aee099ac68f132661b36f3607fa

Contents?: true

Size: 605 Bytes

Versions: 12

Compression:

Stored size: 605 Bytes

Contents

module VagrantPlugins
module CORL
module Action
class InitKeys < BaseAction

  def call(env)
    super do
      env[:ui].info I18n.t("corl.vagrant.actions.init_keys.start")
      
      if node.public_key
        ssh_key = ::CORL::Util::Disk.read(node.public_key)
        
        if ssh_key && ! ssh_key.empty?
          vm.communicate.tap do |comm|
            comm.execute("echo '#{ssh_key}' > \$HOME/.ssh/authorized_keys")
          end
          node.set_cache_setting(:use_private_key, true)
          node.machine.load
        end
      end      
      @app.call env
    end
  end
end
end
end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
corl-0.4.28 lib/core/vagrant/actions/init_keys.rb
corl-0.4.27 lib/core/vagrant/actions/init_keys.rb
corl-0.4.26 lib/core/vagrant/actions/init_keys.rb
corl-0.4.25 lib/core/vagrant/actions/init_keys.rb
corl-0.4.24 lib/core/vagrant/actions/init_keys.rb
corl-0.4.23 lib/core/vagrant/actions/init_keys.rb
corl-0.4.22 lib/core/vagrant/actions/init_keys.rb
corl-0.4.21 lib/core/vagrant/actions/init_keys.rb
corl-0.4.20 lib/core/vagrant/actions/init_keys.rb
corl-0.4.19 lib/core/vagrant/actions/init_keys.rb
corl-0.4.18 lib/core/vagrant/actions/init_keys.rb
corl-0.4.17 lib/core/vagrant/actions/init_keys.rb