From 513a9bf1ab218eebf8eca14787748e15525b9625 Mon Sep 17 00:00:00 2001 From: Timothy Messier Date: Tue, 29 Apr 2014 10:28:57 -0400 Subject: [PATCH] Set u+w perms on private keys in tmp dir. This should allow additional `vagrant provision` calls to work when using the salt provisioner and providing private keys. See #3542. --- plugins/provisioners/salt/provisioner.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/provisioners/salt/provisioner.rb b/plugins/provisioners/salt/provisioner.rb index d8013fe2e..02c443fa3 100644 --- a/plugins/provisioners/salt/provisioner.rb +++ b/plugins/provisioners/salt/provisioner.rb @@ -159,12 +159,14 @@ module VagrantPlugins if @config.minion_key and @config.minion_pub @machine.env.ui.info "Uploading minion keys." @machine.communicate.upload(expanded_path(@config.minion_key).to_s, temp_config_dir + "/minion.pem") + @machine.communicate.sudo("chmod u+w #{temp_config_dir}/minion.pem") @machine.communicate.upload(expanded_path(@config.minion_pub).to_s, temp_config_dir + "/minion.pub") end if @config.master_key and @config.master_pub @machine.env.ui.info "Uploading master keys." @machine.communicate.upload(expanded_path(@config.master_key).to_s, temp_config_dir + "/master.pem") + @machine.communicate.sudo("chmod u+w #{temp_config_dir}/master.pem") @machine.communicate.upload(expanded_path(@config.master_pub).to_s, temp_config_dir + "/master.pub") end end