Commit Graph

296 Commits

Author SHA1 Message Date
Brian Cain 0aaa2cc147
Fixes #11173: Show guest name in hostname erorr message
This commit adds the machine guest name in the hostname validation error
message so that it's easier to see which guest in a Vagrantfile has the
validation error.
2019-11-04 08:41:51 -08:00
Brian Cain a22acba467
Simplify line and path checks for exception handling in config loading 2019-09-10 13:27:23 -07:00
Brian Cain 09a37e0767
Fixes #11022: Ensure correct line is used for windows exceptions
Prior to this commit, if there was a config error inside a provider
block, Vagrant wouldn't grab the right backtrace token on windows since
the api is different for ruby on Windows compared to all other
platforms. This commit ensures that the proper line number is chosen so
the error message is correct.
2019-09-06 14:00:46 -07:00
Brian Cain 99b5867559
Update reject to compact 2019-09-05 15:39:24 -07:00
Brian Cain 7b0dc8d528
Update provisioner enhancements from pull request feedback 2019-08-29 13:50:22 -07:00
Brian Cain 07bcfc6077
Add error if both before and after options are set 2019-08-28 16:15:33 -07:00
Brian Cain fc8bf6aed4
Ensure a dependency provisioner isnt configured to rely on another dependency provisioner 2019-08-28 15:52:38 -07:00
Brian Cain c192651e90
Make dependency provisioners experimental 2019-08-28 15:09:38 -07:00
Brian Cain 8c39d9bfed
Add dependency provisioner name to error message 2019-08-28 14:30:32 -07:00
Brian Cain 6777493c46
Include before/after options in final provision hash 2019-08-20 11:31:00 -07:00
Brian Cain 6db03f2aed
Check if rejected entries are nil, not blank 2019-08-20 11:30:42 -07:00
Brian Cain d15bac7fb7
Validate that before/after provisioner exists in machines config 2019-08-19 14:48:06 -07:00
Brian Cain 8ecd32de53
Remove comment 2019-08-19 11:36:54 -07:00
Brian Cain 4933610398
Update rubydoc for before/after return types 2019-08-19 11:33:30 -07:00
Brian Cain 66aac23470
Properly set and validate before/after keys for base provisioner class 2019-08-19 11:23:06 -07:00
Brian Cain 28c0f6085c
Attempt to validate top scope provisioner options 2019-08-06 16:18:58 -07:00
Brian Cain e05437ddf2
Add validation method and todo 2019-08-06 15:28:04 -07:00
Brian Cain b82b33d204
Add new before/after options for the base Provisioner class
This commit adds two new options: before, after. These string options
refer to other named Provisioners.
2019-08-06 15:28:04 -07:00
Brian Cain 49ae77b2b8
Update doc string for :run option 2019-08-06 15:28:04 -07:00
Brian Cain 57c4de49f2
Remove "command" string from logger
Since not all triggers are commands, removing the word `command` from
the logger so it is not confused with other types of triggers.
2019-05-13 13:26:47 -07:00
Brian Cain 68e21d8ac5
Merge pull request #10664 from chrisroberts/f-plugin-config-format
Fix format finalization of plugins in Vagrantfile
2019-02-12 10:00:14 -08:00
Brian Cain 0bc0bdd616
Merge pull request #10615 from briancain/introduce-typed-triggers
Introduce :type option for Vagrant triggers
2019-02-12 09:16:01 -08:00
Chris Roberts 2e58e002d6 Fix format finalization of plugins in Vagrantfile 2019-02-11 15:48:43 -08:00
Chris Roberts 61cf179b42 Add base address attribute to vm config 2019-02-01 14:47:11 -08:00
Brian Cain fc4e6e624f
Simplify if-statement in trigger parser 2019-02-01 13:34:15 -08:00
Brian Cain 659aa1c48e
Remove todo in validation 2019-02-01 13:34:15 -08:00
Brian Cain 071d8b09cd
Add machine for hook and action triggers 2019-02-01 13:34:15 -08:00
Brian Cain fefb702359
Introduce `type` and `command` triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Chris Roberts 90a5854684 Fill out ssh options config and remote_user
Include config option within ssh_config command output template. Default
remote_user value to set username value. Include existence check on
provided config value to ensure file is available. Update tests to
include coverage on all changes. Add new options to the docs.
2018-12-11 08:09:43 -08:00
Gavin Williams 122ef7307c Flesh out `:config` support.
Also noticed whilst testing that if the `ProxyCommand` uses `%r`, then
it fails with `unable to find remote user`, so added support for
`config.ssh.remote_user` aswell
2018-12-11 07:51:47 -08:00
Gavin Williams 87e38a0bed Remove 'config' from ssh.defaults, and instead setup in '.connect' 2018-12-11 07:51:47 -08:00
Gavin Williams 87437317dc Add support for passing ssh config file in via config 2018-12-11 07:51:47 -08:00
Brian Cain 6051f3598e
Fixes #10224: Allow validation of config while ignoring provider
This commit adds a new flag to the `vagrant validate` command which
allows users to completely ignore the provider block of a config file.
This is useful for when you are running `vagrant validate` in CI and
don't want to install a valid provider to check the syntax of your
Vagratnfile. When the flag is invoked, a warning will be displayed
saying that the provider block will be ignored and not validated.
2018-10-30 13:37:22 -07:00
Brian Cain f4d618eb58
Fixes #9840: Introduce `ruby` option for trigger
This commit introduces a new option to the core trigger feature: `ruby`.
It can be defined to run ruby code when the trigger is configured to
fire. If you give the ruby block an env and machine argument, the
defined ruby code can use those variables internally.
2018-10-05 12:53:41 -07:00
Brian Cain 424f49b919
Simplify config option to ignore box vagrantfile 2018-09-26 10:31:41 -07:00
Alex Wu 282c7341c9
add a option to ignore the vagrantfile packaged with the box 2018-09-26 10:10:45 -07:00
Brian Cain 58ebd52f99
Add abort option to core triggers
This commit adds a new option `abort`, which when configured, will exit
the Vagrant process completely. If set to `true`, it will exit cleanly
with exit code 0. Otherwise, the exit code can be configured.
2018-09-25 09:40:36 -07:00
Chris Roberts fa9bda9554
Merge pull request #10066 from chrisroberts/e-net-ssh-update
Update net-ssh constraint
2018-07-31 13:48:49 -07:00
Chris Roberts 57e0bb5105 Update net-ssh constraint
Also includes mapping of verify_host_key value to new values
introduced in 5.0.0
2018-07-27 16:30:06 -07:00
Brian Cain 72f3a7be14
Ensure the SecureRandom library is loaded 2018-07-27 13:44:24 -07:00
Chris Roberts a993cbce4e
Merge pull request #10037 from chrisroberts/e-vagrant-plugins-local
Define project specific plugins
2018-07-27 09:57:41 -07:00
Chris Roberts 27a441f0bd
Merge pull request #10001 from chrisroberts/e-wsl-valid-sync
Disable synced folders on non-DrvFs
2018-07-18 16:41:16 -07:00
Chris Roberts 40f4e6f67e Vagrant Environment isolated plugins
Adds support for plugins isolated to a specific `Vagrant::Environment`
which can be managed by the vagrant plugin command using the the
--local flag.
2018-07-17 14:49:41 -07:00
Brian Cain 52c3dcc70e
(#9997) Catch and allow for non-standard exit codes
Prior to this commit, the run trigger option wouldn't catch for failures
outside of the #Subprocess.execute raising exceptions. This commit fixes
that by inspecting the exit code result of the subprocess and using the
new `exit_codes` option to determine how to move forward with the
trigger.
2018-07-09 15:56:26 -07:00
Chris Roberts 859d48d5f5 Restrict synced folder access to DrvFs file systems only within WSL 2018-07-06 16:58:12 -07:00
Chris Yungmann 7fb9d3eb4f propagate unset guestpath 2018-05-08 22:51:30 -05:00
Brian Cain 1ef45d8073
Add warning if vagrant-triggers plugin is installed
To allow users to continue to use the community plugin, this commit adds
a switch that will not load the core trigger feature if it detects the
community plugin is installed. It also allows the user to disable the
warning so they can continue to use the plugin without extra output.
2018-04-26 14:59:09 -07:00
Brian Cain a9be56b356
Code updates based on PR feedback 2018-04-24 10:04:40 -07:00
Brian Cain e25cb51f15
Properly print warnings on config settings that aren't supported 2018-04-20 10:51:38 -07:00
Brian Cain 12b1a3dfe4
Update triggers based on code review 2018-04-20 10:51:38 -07:00