Hello guys,
I found an issue at config.vm.provision "file"
that upload files with default permission of ruby, 644. When I tried to execute the file, the permission doesn't allowed because the user was 'root' and the file owner was 'vagrant'. As the same way, if the permission should be less, it would be changeable.
For to improve this function, would be appropriate create a new optional parameter for set manually the permission for the uploaded file? It would give more power to set the environment. Already it has another way for to do that? If it hasn't I would create the pull request with the improvement.
The function would be, eg: config.vm.provision "file", source: "runnable.sh", destination: "runnable.sh", chmod: "755"
Hi @alexndreazevedo
We call this out in the File provisioner documentation:
If you want to upload files to locations that require elevated privileges, we recommend uploading them to temporary locations and then using the shell provisioner to move them into place.
You'll want to upload the file and then use the shell provisioner to change the permissions or move it into an executable place.
Thanks! :smile:
I think you should re-open this marked as a feature request.
Just because you can fix something with the shell provisioner doesn't mean that the feature is not useful to have built in to the file provisioner.
This make file quite unusable :(
SMH
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I think you should re-open this marked as a feature request.
Just because you can fix something with the shell provisioner doesn't mean that the feature is not useful to have built in to the file provisioner.