Sha256: bcb3f749c9e47d0a0cd7833d0cf78577ffe27d722e9a136641e45147c8f61b71
Contents?: true
Size: 948 Bytes
Versions: 2
Compression:
Stored size: 948 Bytes
Contents
module VagrantPlugins module GuestVyOS module Cap class InsertPublicKey def self.insert_public_key(machine, contents) contents = contents.chomp key_type, key_value, key_name = contents.split() commands = <<-EOS source /opt/vyatta/etc/functions/script-template set system login user vagrant authentication public-keys #{key_name} type #{key_type} set system login user vagrant authentication public-keys #{key_name} key #{key_value} commit save EOS temp = Tempfile.new("vagrant") temp.binmode temp.write(commands) temp.close machine.communicate.tap do |comm| comm.upload(temp.path, "/tmp/vagrant-insert-public-key") comm.execute("bash /tmp/vagrant-insert-public-key") comm.execute("rm -f /tmp/vagrant-insert-public-key") end temp.unlink end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
vagrant-vyos-1.1.1 | lib/vagrant-vyos/cap/insert_public_key.rb |
vagrant-vyos-1.1.0 | lib/vagrant-vyos/cap/insert_public_key.rb |