Sha256: ecbbc84b38abc8db95faa77ecaa47fa224b6f253b2c652d3ad44e801947c12c2
Contents?: true
Size: 865 Bytes
Versions: 12
Compression:
Stored size: 865 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? env[:machine].communicate.tap do |comm| comm.execute("echo '#{ssh_key}' > \$HOME/.ssh/authorized_keys") end node.set_cache_setting(:use_private_key, true) env[:machine].config.ssh.private_key_path = node.private_key # Needed for Vagrant 1.7+ vagrant_key_file = env[:machine].data_dir.join("private_key") ::CORL::Util::Disk.delete(vagrant_key_file) if File.exists?(vagrant_key_file) node.machine.load end end @app.call env end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems