Fix ansible provisioner permission bug
This commit is contained in:
parent
38d48ba153
commit
0d23724a1f
|
@ -125,7 +125,8 @@ module VagrantPlugins
|
|||
inventory_basedir = File.join(config.tmp_path, "inventory")
|
||||
inventory_path = File.join(inventory_basedir, "vagrant_ansible_local_inventory")
|
||||
|
||||
create_and_chown_remote_folder(inventory_basedir)
|
||||
@machine.communciate.sudo("mkdir -p #{inventory_path}")
|
||||
@machine.communicate.sudo("chown -R -h #{@machine.ssh_info[:username]} #{config.tmp_path}")
|
||||
@machine.communicate.sudo("rm -f #{inventory_path}", error_check: false)
|
||||
|
||||
Tempfile.open("vagrant-ansible-local-inventory-#{@machine.name}") do |f|
|
||||
|
@ -159,13 +160,6 @@ module VagrantPlugins
|
|||
return machines
|
||||
end
|
||||
|
||||
def create_and_chown_remote_folder(path)
|
||||
@machine.communicate.tap do |comm|
|
||||
comm.sudo("mkdir -p #{path}")
|
||||
comm.sudo("chown -h #{@machine.ssh_info[:username]} #{path}")
|
||||
end
|
||||
end
|
||||
|
||||
def check_path(path, test_args, option_name)
|
||||
# Checks for the existence of given file (or directory) on the guest system,
|
||||
# and error if it doesn't exist.
|
||||
|
|
Loading…
Reference in New Issue