Class: VagrantPlugins::Dotvm::Injector::AuthorizedKey
- Inherits:
-
Object
- Object
- VagrantPlugins::Dotvm::Injector::AuthorizedKey
- Defined in:
- lib/vagrant-dotvm/injector/authorizedkey.rb
Class Method Summary collapse
Class Method Details
.inject(key: nil, machine: nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/vagrant-dotvm/injector/authorizedkey.rb', line 5 def self.inject(key: nil, machine: nil) if key.type == "file" pubkey = File.readlines(File.(key.path)).first.strip elsif key.type == "static" pubkey = key.key end machine.vm.provision "shell" do |s| s.path = "#{UTILS_PATH}/authorize_key.sh" s.args = [pubkey] s.privileged = false end end |