vmware-archive / salty-vagrant

Use Salt as a Vagrant provisioner.
BSD 2-Clause "Simplified" License
372 stars 64 forks source link

Bug in seed_master option #97

Open msgre opened 11 years ago

msgre commented 11 years ago

In ruby script you copy preseeded keys to temporary dir with filenames like seed-#{name}.pub. Then you copy them to final directory with bash bootstrap script and leave them in "temporary" format seed-#{name}.pub. But under directories like /etc/salt/pki/master/minions/ keys must be in format #{name} (without seed- prefix and .pub extension).

Update please provisioner.rb lib or bootstrap-salt.sh script (I attached simple solution for ruby file bellow).

Thank you!

diff --git a/lib/vagrant-salt/provisioner.rb b/lib/vagrant-salt/provisioner.rb
index 2b50dd6..1291b7a 100644
--- a/lib/vagrant-salt/provisioner.rb
+++ b/lib/vagrant-salt/provisioner.rb
@@ -119,10 +119,10 @@ module VagrantPlugins
           @machine.communicate.sudo("mkdir -p -m777 #{seed_dir}")
           @config.seed_master.each do |name, keyfile|
             sourcepath = expanded_path(keyfile).to_s
-            dest = "#{seed_dir}/seed-#{name}.pub"
-            @machine.communicate.upload(sourcepath, dest)   
+            dest = "#{seed_dir}/#{name}"
+            @machine.communicate.upload(sourcepath, dest)
           end
-          options = "#{options} -k #{seed_dir}" 
+          options = "#{options} -k #{seed_dir}"
         end
ifnull commented 11 years ago

+1

viq commented 11 years ago

Please fix this. There's even a pull request for it - #98