tcnksm / vagrant-secret

Enable to read external secret file for configuration
MIT License
10 stars 2 forks source link

give useful error information if a parameter is not defined? #1

Open fschwiet opened 10 years ago

fschwiet commented 10 years ago

How do I write my Vagrantfile so it gives the user useful guidance in the case the user has not created their secret file, or not included the right parameters?

Is there a good way to warn the user if they have not installed the plugin?

fschwiet commented 10 years ago

Closing this as I'm probably just misusing vagrant-secret.

fschwiet commented 10 years ago

Well I think I'm using vagrant-secret but it still seems problematic. Suppose I create a Vagrantfile using vagrant-secret, and share it. Ok suppose someone else runs it, but they forget to run vagrant secret-init. The output they get is:

> vagrant reload
There are errors in the configuration of this machine. Please fix
the following errors and try again:

shell provisioner:
* Shell provisioner `args` must be a string or array.

It'd be much more helpful for the user to get an error message saying they need to run vagrant secret-init, and tell them the name of the configuration value expected.