Commit graph

4531 commits

Author SHA1 Message Date
sophia
9d01b2c60e
Add endpoint for finding boxes 2022-04-25 12:25:54 -05:00
sophia
80f3549716
Initialize remote box with client 2022-04-25 12:25:54 -05:00
sophia
085e30053e
Load box from machine 2022-04-25 12:25:53 -05:00
sophia
d0f7d89104
Enable box in server mode 2022-04-25 12:25:53 -05:00
sophia
62d7324bfc
go generate 2022-04-25 12:25:52 -05:00
sophia
93e94186ba
Add box endpoints 2022-04-25 12:25:52 -05:00
sophia
d7737effbf
Add id to box 2022-04-25 12:25:52 -05:00
sophia
1c27a57213
Use Box as part of machine proto 2022-04-25 12:25:51 -05:00
sophia
ed76183470
Add Box proto message 2022-04-25 12:25:51 -05:00
sophia
0a878721f5
go generate 2022-04-25 12:25:49 -05:00
sophia
4251b2ff7c
Get first level parent from ruby plugins 2022-04-25 12:24:48 -05:00
sophia
92d7c7b291
go generate 2022-04-25 12:24:48 -05:00
sophia
09a836745a
Don't search for parent plugins that don't exist in the Ruby run time 2022-04-25 12:24:48 -05:00
Chris Roberts
8d5e5b1276
Fix loggers to prevent multiple output
Only the parent logger directly under the root/global logger
    needs to have the outputter set. When set on child loggers
    output will be sent to all outputters defined on child + all
    parents. This provides just a single output behavior.
2022-04-25 12:24:47 -05:00
Chris Roberts
61c3134928
Do not provide environment to capability call 2022-04-25 12:24:46 -05:00
Chris Roberts
c92e283e7a
Update logger outputter when setting within repository
Since all loggers get registered into the internal repository
    when created, intercept the logger and force the outputter
    to stderr so it is properly applied to all logger instances
    that may be created.
2022-04-25 12:24:46 -05:00
Chris Roberts
f976d7a19c
Fix logger configuration to apply to all 2022-04-25 12:24:46 -05:00
Chris Roberts
819a4d28a4
Reconfigure legacy vagrant to utilize hclog 2022-04-25 12:24:46 -05:00
Chris Roberts
be4bbe902f
Generated proto updates 2022-04-25 12:24:46 -05:00
sophia
14d17dfd9d
Return capability execution result 2022-04-25 12:24:41 -05:00
sophia
b2cce38f48
Add rpc endpoint to prune out old jobs 2022-04-25 12:24:40 -05:00
sophia
bb336592ea
Remove 'found' from basis/project/target query results 2022-04-25 12:24:39 -05:00
sophia
54c0b0528d
Add remote host module 2022-04-25 12:24:39 -05:00
sophia
eeb950b987
Support to_proto for ui's 2022-04-25 12:24:39 -05:00
sophia
7477455380
Get parents from guest plugin 2022-04-25 12:24:39 -05:00
sophia
0588584438
Get local_data from project client 2022-04-25 12:24:37 -05:00
sophia
9599024fa5
Don't setup paths for remote environment 2022-04-25 12:24:37 -05:00
sophia
42796be551
Get machine from project for guest service 2022-04-25 12:24:37 -05:00
sophia
f1e2a73bfa
Don't use just a client to instantiate a machine 2022-04-25 12:24:37 -05:00
sophia
7a5d045083
Setup guest client when initializing guest 2022-04-25 12:24:37 -05:00
sophia
8efc8542b7
Rename guest client 'capability method to match the client interface 2022-04-25 12:24:37 -05:00
sophia
5d46b93a99
Each component client stores their proto 2022-04-25 12:24:37 -05:00
sophia
83a080521e
Add to_proto to machine in order to pass machine protos around to other plugins 2022-04-25 12:24:37 -05:00
sophia
827b50db77
Get client from machine go impl 2022-04-25 12:24:36 -05:00
sophia
3067fe7dba
Add remote guest 2022-04-25 12:24:36 -05:00
sophia
d196b8635c
Detect Ruby guest plugin 2022-04-25 12:24:36 -05:00
sophia
b8468644f3
Load vagrantfile given by remote project 2022-04-25 12:24:36 -05:00
sophia
ca3d76ca7d
Use project client to populate environment options 2022-04-25 12:24:36 -05:00
sophia
5ca687cad4
Implement project home path, cwd and default private key 2022-04-25 12:24:36 -05:00
Chris Roberts
c1bbc7284b
Generated proto updates 2022-04-25 12:24:35 -05:00
Chris Roberts
f618d991f8
Update RemoteUI name to Remote 2022-04-25 12:24:35 -05:00
Chris Roberts
e090fa4e10
Move UI to remote file and include options to client 2022-04-25 12:24:34 -05:00
Chris Roberts
df53588de5
Store machine client within index entry for use in generating environment 2022-04-25 12:24:34 -05:00
Chris Roberts
99aef42342
Check for server mode before setting constant 2022-04-25 12:24:34 -05:00
Chris Roberts
927fd5e52f
Remove proto requires
They will only be needed when running in server mode, and when
in server mode, they will be loaded at startup
2022-04-25 12:24:34 -05:00
Chris Roberts
b609a44452
Fix method name called on machine client 2022-04-25 12:24:34 -05:00
Chris Roberts
fb629ae4a2
Fix name and use provider_name from client 2022-04-25 12:24:33 -05:00
Chris Roberts
1ae6ca0522
Generated protobuf updates 2022-04-25 12:24:33 -05:00
Chris Roberts
7a1aba1cb9
Use has with indifferent access when loading entry 2022-04-25 12:24:32 -05:00
Chris Roberts
e5184c5719
Call id on client instead of get_id 2022-04-25 12:24:32 -05:00
Chris Roberts
34ecea07bc
Fix method calls when building entry and setting ID 2022-04-25 12:24:32 -05:00
Chris Roberts
9fb979d44c
Extend module on entry not index 2022-04-25 12:24:32 -05:00
Chris Roberts
aaf0ae8504
Generated proto updates 2022-04-25 12:24:31 -05:00
Chris Roberts
8f4bb571a5
Update remote function name and setup 2022-04-25 12:24:30 -05:00
Chris Roberts
b243868ce9
Add remote module for machine index entry 2022-04-25 12:24:30 -05:00
sophia
10a1f1011b
Get datadir for machine and project 2022-04-25 12:24:29 -05:00
sophia
68aa184bee
Get local data path from project 2022-04-25 12:24:28 -05:00
sophia
f722b15661
Remove references to SDK from remote machine index 2022-04-25 12:24:28 -05:00
sophia
f761af3c55
Move client creation into client module 2022-04-25 12:24:28 -05:00
sophia
c71eb9ea0e
UQuery machine index by uuid 2022-04-25 12:24:28 -05:00
sophia
154a4e56f0
Use uuid as Target Index identifier 2022-04-25 12:24:28 -05:00
sophia
83495a4f8b
Fix each machine index machine yielder 2022-04-25 12:24:27 -05:00
sophia
47a0a2d7d2
Record machine client in machine index entry 2022-04-25 12:24:27 -05:00
sophia
6eea1b0afd
Add endpoint for getting all machines from the index 2022-04-25 12:24:27 -05:00
sophia
c5e6a97892
Cache machines in machine index 2022-04-25 12:24:27 -05:00
sophia
8808ef353e
Clean up logging 2022-04-25 12:24:27 -05:00
sophia
f103797592
go generate . 2022-04-25 12:24:27 -05:00
sophia
01fc2926c9
Save machine index entries remotely 2022-04-25 12:24:27 -05:00
sophia
6f54cf51a2
Allow Machine Index entries to have a remote machine reference 2022-04-25 12:24:27 -05:00
sophia
90968ea430
pPss environment client to machine index eentry environment 2022-04-25 12:24:27 -05:00
sophia
3bda8b24ef
Save point: Get a target successfully from target index 2022-04-25 12:24:26 -05:00
sophia
6dae3576a3
Get project ref 2022-04-25 12:24:26 -05:00
sophia
1ea5b2ba91
Save point: use target ref to retrieve info from target index 2022-04-25 12:24:26 -05:00
sophia
663fbab87a
Fill in remote machine index module 2022-04-25 12:24:26 -05:00
sophia
7de0fe1bd8
Get machine index remote service setup 2022-04-25 12:24:26 -05:00
sophia
c123335456
Save point: connect to machine index service 2022-04-25 12:24:26 -05:00
sophia
a5445b708e
go generate 2022-04-25 12:24:26 -05:00
sophia
040f02e60d
Add proto to delete target 2022-04-25 12:24:25 -05:00
Chris Roberts
378019f014
Generated proto updates 2022-04-25 12:24:25 -05:00
Chris Roberts
fe293dfd1f
Require client to be set and provide stub on initial startup
When running in server mode, make the Environment validate a client
option is provided on instantiation. If no client option is provided,
raise an exception since it is required in server mode.

Since an initial Environment is required during start, include a
stub value for the client so the initial Environment can be instantiated
successfully and the GRPC service can be started.
2022-04-25 12:24:23 -05:00
Chris Roberts
3ca9519f5c
Generated proto updates 2022-04-25 12:24:23 -05:00
Chris Roberts
cad5a7f717
Generated proto update 2022-04-25 12:24:21 -05:00
sophia
0d0ff5c5c6
Define communicator configs as plugin configs 2022-04-25 12:24:21 -05:00
sophia
a128d98dea
Move to_proto to config classes 2022-04-25 12:24:21 -05:00
sophia
5128f604ca
go generate 2022-04-25 12:24:20 -05:00
sophia
0e40c2eb97
to_proto save point 2022-04-25 12:24:20 -05:00
sophia
ada96f13a3
Upload targets found in Vagrantfile 2022-04-25 12:24:20 -05:00
sophia
8d1b9a4a8c
Update regex for dummy config fields 2022-04-25 12:24:20 -05:00
sophia
85271c616e
Collect config defined by community plugins 2022-04-25 12:24:20 -05:00
sophia
f316afdd38
Set project and basis configuration type as vagrantfile 2022-04-25 12:24:19 -05:00
sophia
53c822d76a
Define Vagrantfile DB form 2022-04-25 12:24:19 -05:00
sophia
5bfa4a6f48
Move Vagrantfile proto definition to the plugin sdk 2022-04-25 12:24:19 -05:00
sophia
eeb7028a48
Building after rebase 2022-04-25 12:24:19 -05:00
sophia
5f532fc986
Make box url a repeated field 2022-04-25 12:24:18 -05:00
sophia
c2176d5e80
Extract vagrant and communicator settings from Vagrantfile 2022-04-25 12:24:18 -05:00
sophia
849755646b
Define config for config.ssh, winrm, winssh, vagrant 2022-04-25 12:24:18 -05:00
sophia
da58bbc1c1
Get all config.vm.* variables 2022-04-25 12:24:18 -05:00
sophia
b152cc4f2b
Allow dummy config to eval config blocks to set instance variables 2022-04-25 12:24:18 -05:00
sophia
9c1d09eb8a
Extract providers 2022-04-25 12:24:18 -05:00
sophia
81368d83dd
More complicated provider setup 2022-04-25 12:24:18 -05:00
sophia
5467b9134c
Extract network info from Vagrantfile into proto 2022-04-25 12:24:18 -05:00
sophia
36a4a03160
Define the 'config.vm.*' level of the Vagrantfile 2022-04-25 12:24:17 -05:00
sophia
0923f1edf2
Collect config for Vagrantfile config element that does not exist in Ruby 2022-04-25 12:24:17 -05:00
sophia
6899a2a00d
Make Vagrantfile protos more closely resemble the Vagrantfile 2022-04-25 12:24:17 -05:00
sophia
3b6766cfc1
Add Vagrantfile to task definition 2022-04-25 12:24:16 -05:00
sophia
3d25e71970
Add Vagrantfile to proto data model 2022-04-25 12:24:16 -05:00
sophia
71f3b99819
Setup Vagrantfile refs 2022-04-25 12:24:16 -05:00
Chris Roberts
1a7f3d1f96
Generated proto updates 2022-04-25 12:24:13 -05:00
Chris Roberts
8771e6078f
Add parents method to host plugin 2022-04-25 12:24:12 -05:00
Chris Roberts
ca20181019
Proto updates 2022-04-25 12:24:11 -05:00
Chris Roberts
8f222b36de
Generated proto updates 2022-04-25 12:24:10 -05:00
sophia
6805d81301
Update protos 2022-04-25 12:24:10 -05:00
sophia
3c52682226
Host mapper to connect to already running host process 2022-04-25 12:24:09 -05:00
sophia
e86dc5958a
Clean up debugging cruft 2022-04-25 12:24:09 -05:00
sophia
fc8fe0a106
Make status work 2022-04-25 12:24:09 -05:00
sophia
340c2d7b19
Save point: load target from project 2022-04-25 12:24:09 -05:00
Chris Roberts
37d42bc8ef
Update generated proto files 2022-04-25 12:24:09 -05:00
Chris Roberts
a6b3b2969b
Register environment callback for server mode 2022-04-25 12:24:08 -05:00
Chris Roberts
6994f5d5a7
Start adding updates for remote environment in ruby runtime 2022-04-25 12:24:08 -05:00
sophia
f670b7ca5b
Output special character "%"
printf the special character for "things" is % + STUFF, so if you want just a % you have to use the special character % and then combine it with % to get a single %
2022-04-25 12:24:04 -05:00
sophia
1c63921a6c
Clean up ui output to remote extra spaces
Previously the clear line function would insert extra lines making
output look like

"""
==> default: Importing base box 'hashicorp/bionic64'...

Progress: 10%!(NOVERB)

Progress: 20%!(NOVERB)

Progress: 30%!(NOVERB)

Progress: 40%!(NOVERB)
"""

now, output for progress looks like

"""
==> default: Importing base box 'hashicorp/bionic64'...
Progress: 10%!(NOVERB)
Progress: 20%!(NOVERB)
Progress: 30%!(NOVERB)
Progress: 40%!(NOVERB)
"""
2022-04-25 12:24:04 -05:00
sophia
552a43744e
Enable getting user input for ruby plugins 2022-04-25 12:24:04 -05:00
sophia
de649b2154
Update protos 2022-04-25 12:24:03 -05:00
sophia
36fa931bed
AUpdate ruby protos for sdk chagnes 2022-04-25 12:24:02 -05:00
sophia
9f51d87038
Update ruby execute func for new proto 2022-04-25 12:24:02 -05:00
sophia
3107da72af
Execute subcommands 2022-04-25 12:24:02 -05:00
sophia
475c5b41d8
Allow commands to have subcommands specified as a list of command components 2022-04-25 12:24:01 -05:00
sophia
7fb193f4a2
Add dummy endpoint for subcommands 2022-04-25 12:24:01 -05:00
sophia
3c491fafdd
Register subcommands with subcommands passed as part of command info 2022-04-25 12:24:01 -05:00
sophia
261fa5bbae
Fixes for command info message 2022-04-25 12:24:00 -05:00
sophia
1f432350ea
Add dummy endpoint for subcommands 2022-04-25 12:24:00 -05:00
Chris Roberts
ab59e254ac
Revert addition of readers as they are no longer required 2022-04-25 12:24:00 -05:00
Chris Roberts
a39eebd882
Include prepended method for adding reader 2022-04-25 12:23:59 -05:00
Chris Roberts
a103f6fb17
Restore the machine class and update thin class to remote module 2022-04-25 12:23:59 -05:00
Chris Roberts
3512028ca4
Define callbacks which should be run when enabling server mode 2022-04-25 12:23:59 -05:00
Chris Roberts
d501d77005
Add accessors to get to cli components 2022-04-25 12:23:59 -05:00
Chris Roberts
b601872287
Update protos 2022-04-25 12:23:59 -05:00
sophia
c1ce1016c7
Render ruby protobufs to ruby lib 2022-04-25 12:23:57 -05:00
sophia
bb6174d305
Log output to file 2022-04-25 12:23:57 -05:00
sophia
b54d425038
Update Ruby protos for updates to sdk + pick up environment service 2022-04-25 12:23:57 -05:00
Chris Roberts
cbc2ecac0a
Generated proto updates 2022-04-25 12:23:56 -05:00
Chris Roberts
70a2c977d9
Stub in just enough in the thin machine to get things working 2022-04-25 12:23:56 -05:00
Chris Roberts
fc129977af
Add very basic thin machine implementation against client 2022-04-25 12:23:56 -05:00
Chris Roberts
1a6aeb5811
Update proto file locations 2022-04-25 12:23:56 -05:00
Chris Roberts
a37d1b70a5
Remove client autoload since it does not exist here 2022-04-25 12:23:56 -05:00
Chris Roberts
b7616bdd5d
Add generated proto files for the vagrant service 2022-04-25 12:23:55 -05:00
Chris Roberts
c09fc7be1e
Whitespace cleanup 2022-04-25 12:23:55 -05:00
Chris Roberts
c887a18437
Allow UI instance to be provided to environment and used properly 2022-04-25 12:23:55 -05:00
Chris Roberts
7b70925f47
Provide thick and thin implementations of machine 2022-04-25 12:23:55 -05:00
Chris Roberts
03ac9cd015
Provide machine implementation based on server mode 2022-04-25 12:23:55 -05:00
Chris Roberts
4701cb336e
Add helpers to flag when running in server mode 2022-04-25 12:23:55 -05:00
Chris Roberts
7350b85902
Implement enough of the command service to get things working.
Also updates the UI setup so that we can properly get the
    output streaming back to us.
2022-04-25 12:23:55 -05:00
sophia
854a2a4022
Just get the flag names 2022-04-25 12:23:55 -05:00
Chris Roberts
02b08ac12c
Remove option parser modifications for storing flags 2022-04-25 12:23:54 -05:00
sophia
1109d89616
Collect flag information 2022-04-25 12:23:54 -05:00
sophia
43e4e968ef
Make help message work 2022-04-25 12:23:54 -05:00
sophia
cadcbe82f7
Hard code less 2022-04-25 12:23:54 -05:00
sophia
5fc0b22efd
Make machine initialization work 2022-04-25 12:23:54 -05:00
sophia
e3d8418081
Machine getters to use machine client 2022-04-25 12:23:54 -05:00
sophia
46f5fa5ab8
Machine client implementation 2022-04-25 12:23:54 -05:00
sophia
078a091709
Start replacing machine variables with calls to core service 2022-04-25 12:23:54 -05:00
sophia
4c26f5b384
Make machine with ui 2022-04-25 12:23:54 -05:00
sophia
fd74318bf5
Pass ui to machine 2022-04-25 12:23:54 -05:00
sophia
12627a78a3
Make ui class for interacting with terminal ui service 2022-04-25 12:23:53 -05:00
sophia
c99348413a
Make ui class for interacting with terminal ui service 2022-04-25 12:23:53 -05:00
sophia
ea64673e9f
Add terminal client 2022-04-25 12:23:53 -05:00
sophia
3c360722df
Allow communicator to use plugin config 2022-04-25 12:23:53 -05:00
sophia
ad74f18719
Add communicators 2022-04-25 12:23:53 -05:00
sophia
0b1df4593e
Get some more information about Vagrantfile 2022-04-25 12:23:53 -05:00
sophia
eb165d43d1
Add proto defs for Vagrantfile parser service 2022-04-25 12:23:53 -05:00
Chris Roberts
721648bc4f
Update generated proto files 2022-04-25 12:23:52 -05:00
Chris Roberts
addf420ca2
Add some helper methods and some adjustments to serve setup 2022-04-25 12:23:52 -05:00
sophia
d7f92f9d87
Some update for sdk changes 2022-04-25 12:23:52 -05:00
sophia
74c17de0e1
update protos from sdk chagnes 2022-04-25 12:23:52 -05:00
sophia
7ff0d11582
Move protos into Vagrant module 2022-04-25 12:23:52 -05:00
sophia
773c4bd910
Return an ActionResp 2022-04-25 12:23:52 -05:00
sophia
41f3af51af
Return a result from an up action 2022-04-25 12:23:51 -05:00
sophia
a25381b03a
Get the associated requested provider 2022-04-25 12:23:51 -05:00
sophia
7a612698a5
Transform a machine arg to an instance of Vagrant::Machine 2022-04-25 12:23:51 -05:00
sophia
a806a47a1a
Decode incoming machine arg 2022-04-25 12:23:51 -05:00
sophia
a11f5a4dbf
Move proto files into more globally accessible spot 2022-04-25 12:23:51 -05:00
sophia
82e3dd55ad
Setup machine client 2022-04-25 12:23:51 -05:00
Chris Roberts
d896d7b296 Algorithm must be set for key exchange to enable it for key exchange 2021-11-09 09:12:25 -08:00
Chris Roberts
6810c7b4bb Add version capability to darwin host plugin 2021-11-02 16:43:26 -07:00
Darragh Bailey
0c6d6d8e9d Improve Gem spec selection when resolving
When computing the solution set, if a gem is already loaded, make sure
to use the specification of the loaded one instead of the first
available as otherwise there is a risk that when multiple matches are
available the specification for the wrong version may be picked.

When this happens an error message will be triggered that looks like

  can't activate json-2.3.0, already activated json-2.5.1

This can occur for distribution packaged vagrants as well as installs
for development purposes where the ruby install may contain a default
gem spec of an older version than is needed.

Fixes: #12521
Fixes: vagrant-libvirt/vagrant-libvirt#1390
2021-11-01 17:31:48 +00:00
Chris Roberts
ae7639ec23 Validate VirtualBox hostonly network range
VirtualBox introduced a restriction on the valid range for hostonly
    networks. When using a version of VirtualBox which includes this
    restriction a check is performed on the defined IP address to validate
    it is within either the default range (as defined in the VirtualBox
    documentation) or the values defined in the network configuration
    file.
2021-10-28 17:12:15 -07:00
Pedro Furtado
a8e00cb01d
Update environment.rb 2021-07-09 21:32:22 -03:00
Chris Roberts
bbd1404c1e
Merge pull request #12437 from chrisroberts/line-buf-shell-util
Line buffer utility and shell provisioner usage
2021-06-29 13:11:19 -07:00
Chris Roberts
32757d56e1
Merge pull request #12304 from grahamhub/issue-12191
implement --info flag for package cmd #12191
2021-06-29 13:07:47 -07:00
Chris Roberts
de8da71c41
Merge pull request #12431 from chrisroberts/ui-tests
Update tests to use real UI instance
2021-06-29 12:47:26 -07:00
Chris Roberts
6cc6b89dcf Include line buffer util in autoloads 2021-06-29 11:04:14 -07:00
Chris Roberts
35de0d724e Remove stringio usage from line buffer util, add max buffer length 2021-06-29 11:04:14 -07:00
sophia
0a1b20bb07 Get powershell path in %WINDIR%/System32 2021-06-29 10:34:57 -05:00
Rui Lopes
ef18b45786 ensure that the shell provisioner only emits complete output lines to the ui
partial lines are buffered until they are complete (have a line ending)

see https://github.com/hashicorp/vagrant/issues/11047
2021-06-25 15:58:24 -07:00
Chris Roberts
3d0d0148e9 Update tests to use real UI instance
Replaces use of UI doubles within tests to use actual UI instance
    to ensure calls are passing parameters correctly.
2021-06-23 14:04:48 -07:00
Chris Roberts
ac958314ae
Merge pull request #12415 from chrisroberts/ssh-rsa-dep-fix
Flag RSA SHA1 deprecation when loading keys
2021-06-22 15:48:20 -07:00
Chris Roberts
e7a6f397da Updates for Ruby 3.0 2021-06-21 15:57:46 -07:00
Chris Roberts
46aca8be5a Flag RSA SHA1 deprecation when loading keys
Set flag on RSA keys of deprecated RSA SHA1 support when loading
    keys based on server version of the transport. This ensures keys
    are properly flagged. Flag name has been updated to provide context
    on usage.

    Version matching on the OpenSSH server version has also been updated
    to handle customized naming in the version string (as seen in the
    Windows port) and to properly handle when no match is found.

    Fixes #12344 #12408 #12381
2021-06-10 21:17:08 -07:00
Chris Roberts
5967a23fa0 Support pwsh executable name for powershell
This updates the powershell detection to look for the `pwsh` executable
    and use it when the powershell executable is not available.
2021-04-28 12:45:48 -07:00
grahamhub
bfa73b06c6 cli: implement --info flag for package #12191 2021-04-15 00:28:41 -05:00
Chris Roberts
a08597d787 Tighten constraints on net-ssh to ensure functionality. Update patch
Keep the constraint on net-ssh tight so we can be confident that the
    patching will be successful and that a net-ssh release won't inadvertently
    cause our local updates to become non-functional.

    Fix patch to only update the behavior for RSA based keys when the server
    is recent enough to include the signature changes
2021-04-13 10:58:59 -07:00
Chris Roberts
246058ffbb Add #signature_algorithm and update #ssh_do_sign and #to_blob
Modifies `OpenSSL::PKey::RSA` to provide a `#signature_algorithm`
    method which provides the signature algorithm value expected by
    OpenSSH. The `#ssh_do_sign` method is updated to use the set
    algorithm (SHA256) and `#to_blob` is updated to include the
    signature algorithm instead of the key type.
2021-04-12 17:28:52 -07:00
sophia
b480790a8d Add box directly with authed urls 2021-04-05 16:39:01 -05:00
Chris Roberts
7362ac52e4 Fix dependency resolution where default gems are included
Parts of the stdlib which have been externalized but are still
    included within Ruby introduce issues when pinning Vagrant's
    dependencies to resolve plugin installs. When determining
    Vagrant's dependency list prior to solution generation, check
    the specification and ignore any default gems to prevent
    pinning versions that are not actual dependencies.
2021-03-25 12:35:33 -07:00
Chris Roberts
5b6fc4c0bb
Merge pull request #12250 from chrisroberts/cloud-upload-sized
Check file size prior to upload and automatically adjust options
2021-03-24 13:01:15 -07:00
Chris Roberts
fd4da92245 Check file size prior to upload and automatically adjust options
When uploading box file, check if the size is greater than
    5GB. If the size is larger and the direct to storage option
    is enabled, disable the option due to current 5GB restriction
    on direct uploads.
2021-03-23 15:11:32 -07:00
Ikko Ashimine
4dca0b90fa
Fix typo in vagrantfile.rb
inital -> initial
2021-03-23 18:16:45 +09:00
Chris Roberts
60323fdd6c
Merge pull request #12235 from chrisroberts/api-notify-ups
Prevent notification on default store, fix client end point
2021-03-17 13:57:47 -07:00
Chris Roberts
c6153ff84f Remove deprecation log messages 2021-03-15 15:36:33 -07:00
Chris Roberts
d3fffd65d2 Prevent notifications on redirect to default store
This also checks if the redirect notification has been displayed
    before inspecting the source and location to prevent repeat checks
    after the notification has been sent.
2021-03-15 15:21:07 -07:00
Chris Roberts
51382a0d0a Deprecate hook and disable access token parameter by default
This sets the `authenticate_box_url` hook as deprecated and also
    disables the cloud auth middleware from adding an access token
    as a URL parameter by default. An environment variable has been
    added which can be used for re-enabling the access token URL
    parameter behavior if required for some legacy system which does
    not support the authorization header.
2021-03-15 14:46:46 -07:00
Connor Martin
e92fe5d720 Merge branch 'main' of github.com:hashicorp/vagrant into remove-space 2021-03-11 17:20:57 -06:00
Chris Roberts
80ec78929a Adjust syntax on method 2021-03-09 08:05:55 -08:00
Chris Roberts
55dc18cb96 Default the builtin specs when initializing 2021-03-08 17:14:14 -08:00
Chris Roberts
32f4951759 Activate builtin specs during startup
When starting up, and before any loading, find our current
    specification and activate all the internal dependencies
    while also collecting the activated specifications. Store
    these for later use when doing plugin resolutions. We bypass
    the builtin list when running in bundler since they will
    still show up as not activated, but we use the entire list
    regardless.
2021-03-08 16:25:13 -08:00
Chris Roberts
282dadf784 When not running inside bundler, only use specifications that are activated 2021-03-08 15:58:47 -08:00
Chris Roberts
2d019cb608 Provide specialized messages on plugin install failure if possible
Inspect the error message received when failing to install a
    plugin. If it's something we can determine the cause, send
    back a cleaner error message to the user on how to resolve.
2021-03-08 15:57:13 -08:00
Chris Roberts
034cb8c59e Update net-ssh constraint to non-prerelease version
To prevent resolution issues with the introduction
    of a prerelease constraint, update the net-ssh constraint
    to be a minimum at the latest release. Include monkey
    patches to include support for wanted host key algos.
    The monkey patches are only applied to the latest
    net-ssh currently and will be ignored once the current
    prerelease has been fully released.
2021-02-25 17:07:00 -08:00
Sophia Castellarin
d111596446
Merge pull request #12188 from soapy1/vagrant-does-not-reference-empty-string-vm
Don't try to find "" by prefix in the machine index
2021-02-23 14:24:17 -06:00
Sophia Castellarin
181b4ea890
Merge pull request #12177 from soapy1/apply-download-opts-to-metadata
Apply download options to metadata requests
2021-02-23 13:26:53 -06:00
Sophia Castellarin
f2a1e25783
Merge pull request #12189 from soapy1/box-metadata-download-error
Raise error if downloading box metadata fails
2021-02-23 12:39:42 -06:00
sophia
220f346d2b Make shell script for loop shell agnostic 2021-02-22 12:36:54 -06:00
sophia
4b67216d71 Raise error if downloading box metadata fails 2021-02-12 17:07:04 -06:00
Connor Martin
3f70d44266 assign to a new var 2021-02-12 09:31:32 -06:00
sophia
ab1c3c2547 Don't try to find "" by prefix in the machine index 2021-02-11 15:59:15 -06:00
sophia
44f527ff8e Apply download options to metadata requests 2021-02-09 18:33:20 -06:00
Connor Martin
9a26940114 use strip instead 2021-02-04 14:29:54 -06:00
Connor Martin
1022e5b991 remove all space from checksums 2021-02-01 21:54:10 -06:00
Chris Roberts
203a5f0075 Update filesystem type match for WSL2
Fixes shared folder on WSL2 based on #11705
2020-11-18 10:58:33 -08:00
Chris Roberts
7f6ab8e166
Merge pull request #12054 from chrisroberts/f-sol-file-resolv
Update solution file to use DependencyRequests and allow prerelease
2020-11-17 15:36:44 -08:00
Chris Roberts
c4eda3f08f Update solution file to use DependencyRequests and allow prerelease
Maintain the solution file persisting dependency information on
    disk but update the runtime representation to
    Gem::Resolver::DependencyRequest instances which are expected
    by the sets when locating matches.

    Properly abide by prerelease setting in customized sets and
    force prerelease matching when in the builtin set. If a request
    is matched on a prerelease, and the request itself is not set
    to allow prereleases, update it to ensure successful resolution.
2020-11-17 13:02:33 -08:00
Chris Roberts
157db39938 Remove action name tracking for applying
The raw action name tracking should be sufficient for preventing
multi-insertions where only a single modification should occur.
With action name, hooks _should_ be able to be applied in multiple
builder stacks as they are expanding.

Fixes #12035
2020-11-11 09:56:03 -08:00
Chris Roberts
30f8e7944d Track raw actions as they are applied to prevent multiple insertions
The raw actions are used for applying the original trigger behavior
which can insert before and/or after the entire set of actions. When
processing the stack items, mark when the raw action has been applied
to prevent it from being applied again. Triggers around the raw actions
should only ever be applied _once_.

Fixes #12034
2020-11-11 09:39:07 -08:00
Chris Roberts
b479e04eb4 Request sets need prerelease enabled not just the spec matching 2020-11-06 15:22:28 -08:00
Chris Roberts
18c1607c6e Check dependency list on initialization
When initializing for internal plugin resolution inspect contraints
on all defined dependencies. If a prerelease constraint is detected,
automatically enable prerelease resolution.
2020-11-06 09:07:51 -08:00
Chris Roberts
9506c7b323 Allow enabling prerelease resolution via environment variable 2020-11-06 07:22:01 -08:00
Chris Roberts
a6f838a830
Merge pull request #12014 from chrisroberts/f-broken-trigger-hook
Fix application of action named triggers/hooks
2020-11-03 14:00:19 -08:00
Chris Roberts
cb6aed6045
Merge pull request #12008 from chrisroberts/f-wsl-port-open
Handle Errno::EALREADY exceptions on port checks
2020-11-03 13:59:03 -08:00
Chris Roberts
3ec8d44cf9 Remove debug setup for restclient logger 2020-11-03 13:31:41 -08:00
Chris Roberts
db24f26daa Track application of action name hooks / triggers
When expanding stack track the origin action name and only apply
it once the stack has completed its expansion. The local env data
is marked with origin action to prevent it from being applied in
nested builders as they are expanded. The value of the stored action
name is checked and invalidated if another action is applied to the
same env in the future so hooks / triggers for that action are
applied as expected.
2020-11-02 10:39:15 -08:00
Chris Roberts
cba5bca7de Use variable when sending info to logger 2020-11-02 10:31:28 -08:00
Chris Roberts
7331623a39 Only allow the ui to be overridden when running action 2020-11-02 10:30:56 -08:00
Chris Roberts
16dc9db76b Handle Errno::EALREADY exceptions on port checks
With WSL port checks can end up resulting in Errno::EALREADY being
raised. When encountered, assume port is unavailable.
2020-10-30 13:09:51 -07:00
Chris Roberts
70d36bc7cd Update uploader options to include --fail so failures are reported properly 2020-10-30 09:26:07 -07:00
Chris Roberts
78d309a09b Update cloud command to use refactored library implementation
This PR is dependent on the 2.1.0 release of the vagrant_cloud
library. It updates the `cloud` command to use the new interface
for interacting with the Vagrant Cloud API. It also adds support
for direct to backend storage uploads, and defaults to this
method.

Also included is a bit of cleanup refactoring, addition of method
documentation, and fixing up some small issues around custom username
usage within the internal client for authentication.
2020-10-30 09:26:07 -07:00
sophia
8a8eff130a Allow entity to support content disposition 2020-10-28 16:21:42 -05:00
sophia
799ebb32ed Add tests for mime util 2020-10-28 15:57:45 -05:00
sophia
4cdf60cb0a Create MIME type data 2020-10-28 15:57:45 -05:00
sophia
e2f71dd55d Update mime gem 2020-10-28 15:57:45 -05:00
Rui Lopes
fcdc63ff89 let the user configure the cloud_init mime part content-disposition filename 2020-10-28 15:57:45 -05:00
Sophia Castellarin
70d37e8a9c
Merge pull request #11835 from soapy1/remove-url-token
Download a box by setting auth headers
2020-09-22 15:35:30 -05:00
Sophia Castellarin
6e8be9f9ef
Merge pull request #11863 from soapy1/include-index
Include index
2020-09-15 15:47:35 -05:00
sophia
d6a88f666f Add some docstrings and logging 2020-09-15 15:01:01 -05:00
sophia
5607428a66 Don't try to recover machine without a uuid 2020-09-15 11:16:13 -05:00
Sophia Castellarin
0d79bd9f99
Merge pull request #11893 from dcermak/remove_erubis
Switch from unmaintained gem erubis to erubi
2020-09-15 09:59:25 -05:00
sophia
f9b1d52ec6 Catch error for when guest is not available 2020-09-10 16:28:38 -05:00
Dan Čermák
ce8230ccfb
Switch from unmaintained gem erubis to erubi
Rails switched to erubi as well, as erubis has not seen any new releases since 2011.
2020-09-10 10:52:47 +02:00
sophia
e619a6a930 Catch nil input for querying machine index 2020-08-28 16:13:43 -05:00
Sophia Castellarin
3835da3839
Merge pull request #11797 from soapy1/synced-folder-caps
Synced folder caps for mount options and default fstab modification behaviour
2020-08-21 11:44:15 -05:00
sophia
fffc555faf Add tests for new hook 2020-08-21 10:54:43 -05:00
sophia
e96d60c029 Add tests for persisting shared folders 2020-08-20 18:24:09 -05:00
sophia
e2f012ff58 Escape value being scrubbed 2020-08-20 18:03:01 -05:00
sophia
943047d003 Add tests for synced folder collections 2020-08-19 17:57:57 -05:00
sophia
bb5d0e9c28 Remove credentials scrubbing from caching synced folders
Passwords are (and should) never stored be as part of folder data.
I think there is also a case to be made about desensitizes
information here can lead to leaking of credentials. For example if
an exported folder is named "vagrant" and the users password is
"vagrant", the synced_folder cache will show "****" in place of the
folder name, indicating that it is also password.
2020-08-19 17:43:22 -05:00
sophia
56fa014af8 Don't persist shared folders if mount options capability not provided 2020-08-19 15:47:21 -05:00
Chris Roberts
cd2d84fda7 Adjust synced folder collection class 2020-08-19 15:00:40 -05:00
sophia
7577c11eb6 Persist synced folders in action 2020-08-19 15:00:40 -05:00
sophia
1a3136b9fe Allow types to be specified when instantiating a typed hash 2020-08-19 15:00:40 -05:00
sophia
bc898e385d Update tests for synced folder typed hash 2020-08-19 15:00:40 -05:00
sophia
2239ee8582 Create Hash with type attribute 2020-08-19 15:00:40 -05:00
sophia
faad9f2717 Add tests 2020-08-19 15:00:40 -05:00
sophia
cde39e26ba Make mount options a synced_folder capability 2020-08-19 15:00:40 -05:00
sophia
afd2a28f60 Add synced_folder_capability 2020-08-19 15:00:40 -05:00
sophia
0d1635303f Sperate hook for authenticating url and adding headers for authentication 2020-08-18 17:42:59 -05:00
sophia
27b37ea838 Scrub credentials as whole words, don't capture matching substrings 2020-08-18 11:38:04 -05:00
sophia
b5f6df9ec0 Download a box by setting auth headers 2020-08-18 10:13:39 -05:00
Chris Roberts
e9ece2ab58
Merge pull request #11814 from chrisroberts/f-dep-warns
Updates to address all Ruby deprecations and warnings
2020-08-12 09:07:10 -07:00
Chris Roberts
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
Chris Roberts
98ffa4add0 Speed up open port detection 2020-08-07 16:38:15 -07:00
Chris Roberts
05a3e122fb Only warn when configured host IP is not found on local device 2020-08-07 16:38:15 -07:00
Sophia Castellarin
a2811909be
Merge pull request #11618 from jbonhag/fix/empty-box
Treat an empty box value as invalid
2020-08-07 11:18:33 -05:00
Sophia Castellarin
be10e060e6
Merge pull request #11732 from soapy1/detach-from-subprocess
Detach from subprocess
2020-08-07 11:11:03 -05:00
Sophia Castellarin
bedd141381
Merge pull request #11721 from jbonhag/f/ssh-nil-exit-status
Raise an error on nil exit status
2020-08-07 10:55:58 -05:00
Sophia Castellarin
2d59b4f8dd
Merge pull request #11807 from soapy1/sanatize-mount-command
Capture escape character [3J
2020-08-07 10:53:01 -05:00
Sophia Castellarin
c17ba03904
Merge pull request #11773 from soapy1/cloud-init-wait-action
Add cloud init wait action
2020-08-06 16:28:45 -05:00
sophia
8a766ca9ab Capture escape character [3J 2020-08-06 15:50:51 -05:00
sophia
a1d429a4e8 Raise more descriptive error if cloud init fails 2020-08-06 15:47:36 -05:00
Jeff Bonhag
3a1705b50a
Make sure we don't run an empty box 2020-07-31 15:29:06 -04:00
Sophia Castellarin
b41db6bebe Output cloud init messages to user
Co-authored-by: Jeff Bonhag <jbonhag@hashicorp.com>
2020-07-31 12:10:43 -05:00
Jeff Bonhag
db57af5bca
Write meta-data as yaml 2020-07-31 11:58:06 -04:00
Jeff Bonhag
c60d1f8565
Set MIME-Version for user data 2020-07-31 11:57:56 -04:00
Jeff Bonhag
f0f681716d
Merge pull request #11787 from fliam/fix-privileged-powershell-executable-on-wsl
Use the correct powershell executable for privileged commands
2020-07-30 16:11:00 -04:00
Sophia Castellarin
f49e9f9700
Merge pull request #11719 from soapy1/change-host-name-cap-darwin
Make darwin + openbsd +freebsd guest respect 'hostname' network config option
2020-07-30 12:27:38 -05:00
Sophia Castellarin
99c34855ef
Merge pull request #11750 from soapy1/build-iso-module
Refactor building ISO cap
2020-07-29 14:16:04 -05:00
sophia
0a5a940e58 Raise an error if cloud-init is not found on guest 2020-07-29 12:50:50 -05:00
sophia
476977a732 Close and unlink iso tempfile
On Windows tempfile.delete does not delete the file. It needs
to be closed and unlinked
2020-07-28 11:24:15 -05:00
Liam Feid
3898d02259 Use the correct powershell executable for privileged commands 2020-07-28 07:48:41 +02:00
sophia
5caae15f22 Move isofs_available cap to plugin 2020-07-23 14:42:45 -05:00
Sophia Castellarin
cb1ade9332
Merge pull request #11523 from soapy1/install-autocomplete-cmd
Install zsh autocomplete
2020-07-23 13:59:36 -05:00
Sophia Castellarin
3d4b721a22
Merge pull request #11579 from soapy1/provisioner-communicator_required
Provisioner communicator required
2020-07-17 10:45:34 -05:00
sophia
e5d7813b0a Call cap for building iso 2020-07-16 15:40:45 -05:00
sophia
3f867e0df4 Add cloud init wait action 2020-07-16 15:40:39 -05:00
Jeff Bonhag
eecf1dbe57
Add validation error for empty box
This commit adds a unique error message for an empty box value. It
requires modifications to vagrantfile.rb because some Vagrantfile config
is used before validation occurs.
2020-07-13 17:46:28 -04:00
Jeff Bonhag
ff9f9c40e8
Differentiate between controller "not found" errors
This commit adds a new error message to be raised if a VM has no
supported storage controllers. This lets us differentiate between two
different "controller not found" scenarios:

1. If we are looking for a controller that we're expecting to find (i.e.
one that was recorded in the disk metadata file)
2. If we are poking around for the *best* controller to use in a
configuration task
2020-07-09 15:10:50 -04:00
Jeff Bonhag
c9bdcb6839
Error on unsupported storage controller type 2020-07-09 15:07:49 -04:00
Jeff Bonhag
1e6eb0d636
Raise an error if primary disk can't be found 2020-07-09 15:07:49 -04:00
Jeff Bonhag
3a515cc7d6
Error if the required storage controller not found
This commit adds a new error type that can be raised whenever a storage
controller of the required type is not found. This indicates that a user
needs to either add the storage controller manually or change their disk
configuration.

It also removes the last hardcoded instance of "SATA Controller" as a
default argument.
2020-07-09 15:07:48 -04:00
sophia
b1d1c20ff7 Refactor building iso 2020-07-08 11:40:00 -05:00
sophia
4a77060805 Add linux cap 2020-07-08 11:15:26 -05:00
sophia
33d7c94320 Refactor iso building into a util 2020-07-08 10:24:21 -05:00
Sophia Castellarin
02ef62dcff
Merge pull request #11694 from soapy1/host-cap-build-iso
Build iso for Darwin host
2020-07-07 10:29:52 -05:00
sophia
1661d1f1cf Print help message if user provides and ambiguous option 2020-07-06 10:52:05 -05:00
sophia
ee90e11832 Test detach option 2020-06-30 17:24:25 -05:00
sophia
384e327b9e Add detach option to Util::Subprocess 2020-06-30 15:59:39 -05:00
sophia
8bad23d176 Update OpenBSD guest change hostname cap 2020-06-29 17:02:43 -05:00
Brian Cain
39c3ee7230
Update code style for map/each methods 2020-06-29 11:16:55 -07:00
Brian Cain
4b15435262
Fix method docs 2020-06-29 11:00:16 -07:00
Brian Cain
3caca048c8
Update setup to decouple disk attachment from user_data setup 2020-06-29 11:00:16 -07:00
Brian Cain
d6fc70dd68
Include volume_id in iso host cap params 2020-06-29 11:00:16 -07:00
Brian Cain
39a12de38f
Ensure meta-data is also included in cloud-init iso 2020-06-29 11:00:16 -07:00
Brian Cain
6797b96cae
Save file as user-data 2020-06-29 11:00:16 -07:00
Brian Cain
42718437ab
Initial commit of cloud_init setup action
This commit introduces a new builtin action for preparing and
configuring guests cloud_init configs as an iso to be attached later by
the disk actions
2020-06-29 11:00:16 -07:00
sophia
db6d1b4aa6 Make darwin guest respect 'hostname' network config option 2020-06-29 12:03:12 -05:00
Jeff Bonhag
9af48e5764
Raise an error on nil exit status
This commit changes the SSH communicator to raise an error if Vagrant
doesn't receive an exit status from an SSH command, for example if the
command is terminated by the OOM-killer.
2020-06-26 13:25:59 -04:00
Sophia Castellarin
955f1f1b25
Merge pull request #11656 from soapy1/recover-from-missing-global-data
Add local machine to global index of machines if it does not exist
2020-06-17 15:18:48 -05:00
Jeff Bonhag
f9f2fc0dd5
Merge pull request #11654 from jbonhag/fix/loopback-forward
Fix #11640: Check port of loopback address
2020-06-16 14:54:16 -04:00
Sophia Castellarin
71185e3756
Merge pull request #11679 from soapy1/invalid-mask
Validate netmask value from VirtualBox
2020-06-16 09:36:19 -05:00
sophia
1ff6582fff Refactor out shared utility 2020-06-16 09:32:37 -05:00
sophia
e3e573c133 Rescue if an invalid netmask is provided 2020-06-15 17:06:07 -05:00
Chris Roberts
c9a65ac75b
Merge pull request #11688 from chrisroberts/f-trigger-all
Fix trigger matching on `:all` special value
2020-06-15 14:15:26 -07:00
Sophia Castellarin
d9bbdab428
Merge pull request #11567 from soapy1/suse-hosts-mod
Set hostname according to hostname flag and ip for suse
2020-06-15 14:29:43 -05:00
sophia
e1d104a8e3 Build iso for Darwin host 2020-06-15 09:55:15 -05:00
Chris Roberts
f26440ee38 Only allow the all special value to be matched when requested
This prevents the all special value from being matched on the
non-defined raw action names when the typed triggers support
is enabled.
2020-06-12 17:09:31 -07:00
sophia
b02a78c661 Change config option to allow_hosts_modification 2020-06-12 14:50:07 -05:00
sophia
ff0aea4493 Add option to disable modification of /etc/hosts on guest 2020-06-12 14:25:19 -05:00
Chris Roberts
916655dbd3 Fix trigger matching on :all special value
Updates the type to do a proper comparison when checking for
the `:all` special value as well as applied ignores.

Fixes #11599
2020-06-09 16:12:48 -07:00
sophia
132720e3b4 Add local machine to global index of machines if it does not exist 2020-06-09 17:22:55 -05:00
sophia
66a3b58c08 Add provider capaiblity :has_communicator 2020-06-09 09:33:11 -05:00
sophia
36a086a4d1 Validate netmask value from VirtualBox 2020-06-08 12:21:29 -05:00
Jeff Bonhag
73130e3ff6
Switch to Vagrant::Util methods 2020-05-29 15:51:24 -04:00
sophia
9b6c562016 Set run config for provisioner 2020-05-29 15:33:43 -04:00
sophia
1a3e6c8ed5 Allow provisioner to take list of provisioners to run 2020-05-29 15:33:42 -04:00
Jeff Bonhag
270462fc89
Fix #11640: Check port of loopback address
If the given host_ip is a loopback address, proceed with the regular
port check.
2020-05-29 15:30:21 -04:00
sophia
043008a3c4 Raise error if trying to install unsupported shell 2020-05-29 15:10:13 -04:00
sophia
75de83db9e Simplify some install operations 2020-05-29 15:10:13 -04:00
sophia
4169ea6e57 Allow users to choose which shells to install 2020-05-29 15:10:13 -04:00
sophia
9e2b7fb690 Autocomplete command 2020-05-29 15:10:13 -04:00
sophia
1058a38f46 Clean up output to user 2020-05-29 15:10:13 -04:00
sophia
a59eedb748 Rework install shell config classes 2020-05-29 15:10:13 -04:00
sophia
d6175e0c66 Give feedback to user about which files have been modified for autocopmletion to be enabled 2020-05-29 15:10:13 -04:00
sophia
f25c3ef9fa Install autocomplete for bash 2020-05-29 15:10:13 -04:00
sophia
6430640d28 Extract more generic shell class 2020-05-29 15:10:13 -04:00
sophia
89503d9a66 Install zsh autocomplete 2020-05-29 15:10:13 -04:00
sophia
85fd3b79fe Refactor editin guest /etc/hosts into a util 2020-05-29 15:08:39 -04:00
Brian Cain
fab786cc28
Merge pull request #11602 from briancain/feature/docker-port-collision-fix
Fixes #9067: Ensure new containers don't grab existing bound ports
2020-05-29 08:37:23 -07:00
Brian Cain
19d724dcd4
Remove unused require for MapCommandOptions class 2020-05-20 10:46:09 -07:00
Brian Cain
64ed950fd8
Put back methods as instance methods 2020-05-18 10:39:21 -07:00
Brian Cain
c18ceb20bc
Define custom port_check method for halted docker containers 2020-05-12 11:17:15 -07:00
Brian Cain
5aff6660fb
Move port checker method to class rather than instance
This commit also moves out the ipv4_interfaces method to be a util
method, so that the port checker can also access it as a class mehtod
2020-05-12 10:54:23 -07:00
Brian Cain
b2d9abe344
Fixes #9067: Ensure new containers don't grab existing bound ports
Prior to this commit, if a created but exited container bound a port,
and a new container grabed that same port (say for an ssh port forward),
when the initial container came back up it would fail because the port
also got bound to the second container. This commit fixes that behavior
by first looking at what containers are already bound prior to creating
a container.
2020-05-11 10:17:22 -07:00
Chris Roberts
5195bee9ea Check if plugin install provides specification
During a plugin install, if the plugin is already installed and
activated, no specification will be returned as there was nothing
new installed. In this situation, look for the requested plugin
within the activated specifications. If it is found, then proceed
since the plugin is installed. If it is not found, return an error.
2020-05-06 15:51:37 -07:00
Chris Roberts
f5b75ed0d6 Update IO util to properly handle unknown conversion errors
When converting encoding to UTF-8 on Windows, allow for unknown
conversions to be properly handled and prevent generating an
error.
2020-05-04 13:25:53 -07:00
Chris Roberts
307d7f70b6 Allow prerelease matches when Vagrant is a prerelease version
Sets prerelease on the request set based on Vagrant's version. This
allows installing plugins which may include a vagrant version constraint
when running on a development version without needing to a manual local
installation of the gem.
2020-05-01 16:05:49 -07:00
sophia
646de433a9 Validate conversion of map to cmd options 2020-04-29 15:10:48 -04:00
sophia
7e125969dd Add option box_download_options
Allow users to specify a map of extra options to pass to the downloader.
These options will be passed to curl, with a `--` appended to the key
2020-04-29 15:10:44 -04:00
Chris Roberts
4546d804b1 Add support for configuring SSH connect timeout
Retains the original default value of 15 seconds for SSH connect
timeout. Allows users to modify this timeout via SSH communicator
option. Enforces integer values for timeout and validates custom
values are greater than 0.
2020-04-20 14:23:21 -07:00
Sophia Castellarin
5dc96f0886
Merge pull request #11498 from soapy1/ubuntu-w-networkmanager
Choose netplan renderer based on network config and available tools
2020-04-17 09:50:31 -04:00
sophia
538ee948ee Choose netplan renderer based on network config and available tools 2020-04-10 17:17:04 -04:00
Chris Roberts
c5e2f36ddc
Merge pull request #11455 from chrisroberts/enhancement/triggers-insertions
Adjust how trigger actions are inserted into the stack
2020-04-08 16:53:17 -07:00
Sophia Castellarin
a3e8e822e4
Merge pull request #11465 from soapy1/quiet-cli-opt
Quiet cli option
2020-04-06 10:22:29 -04:00
Chris Roberts
5d70cc3bf2 Retain original trigger behavior
These updates allow the after trigger to behave the same as the
original with regards to the execution location of the trigger
within the execution stack.
2020-04-03 15:47:00 -07:00
sophia
39d7cd8997 Wrap all progress type outputs with rewriting to enable --no-tty 2020-04-03 16:28:59 -04:00
Jeff Bonhag
1e7399afa5
Merge pull request #11454 from jbonhag/fix/port-collision-net-test
Fix #11373: Check all interfaces for port collisions on Windows
2020-04-03 13:46:45 -04:00
sophia
e6c387cdce Refactor non interactive UI 2020-03-30 11:26:18 -04:00
sophia
0296e59baf Use :ui_class opt to set ui class 2020-03-30 10:21:14 -04:00
sophia
d230272062 Add NonInteractive UI 2020-03-30 09:32:23 -04:00
sophia
baaaf8e7e6 Output report progress if show progress is enabled 2020-03-30 09:32:23 -04:00
sophia
d6d6e2c362 Surface cli option to quiet progress 2020-03-30 09:32:23 -04:00
sophia
c5a5b3d0b2 Yield output based on ui opts 2020-03-30 09:32:22 -04:00
Chris Roberts
b8702ac889 Include default options in option parser
Adds method to shared helpers for adding procs to be evaluated
which can add default modifications to the option parser used
by commands. Customized option parser class within Vagrant
handles processing defined procs to set options.
2020-03-27 16:57:59 -07:00
Jeff Bonhag
dfad00fd25
Include machine name in error message
This will make it easier for folks to debug networking settings.
2020-03-27 11:49:21 -04:00
Chris Roberts
217f2530db Use machine specific triggers instance when machine is available in runner 2020-03-26 17:20:55 -07:00
Chris Roberts
bcbbc825e0 Add test coverage on builder 2020-03-24 17:15:41 -07:00
Chris Roberts
2e0e772897 Add test coverage on trigger action 2020-03-24 14:32:34 -07:00
Chris Roberts
4b65368852 Update builder to use generic trigger action 2020-03-23 17:10:17 -07:00
Chris Roberts
505715500d Include autoloading for trigger constant 2020-03-23 17:09:46 -07:00
Chris Roberts
5f6ac0a6e4 Update trigger action files 2020-03-23 17:08:44 -07:00
Chris Roberts
8fad4865bb Update before trigger action to be generic trigger action 2020-03-23 17:08:21 -07:00
Jeff Bonhag
00b72aa2c5
bug: test host platform, not guest platform 2020-03-20 09:56:43 -04:00
Jeff Bonhag
9c5291794a
Include interface names in debug log 2020-03-19 18:05:17 -04:00
Jeff Bonhag
6d228becf9
Raise an error if host IP is not found 2020-03-19 17:16:21 -04:00
Jeff Bonhag
705baaad46
Only do special 0.0.0.0 check on Windows hosts
If host_ip is nil or 0.0.0.0, only do the special port check on Windows
hosts, because non-Windows hosts can test 0.0.0.0 directly.
2020-03-18 17:39:33 -04:00
Chris Roberts
d08c68ecf3 Adjust how trigger actions are inserted into the stack
This adjusts how triggers are implemented during a normal run. Any
defined triggers which are applicable are located and injected into
the run stack as the stack is built, including hook type triggers.

Support is included for dynamic hook lookup.

The data type used when defining triggers has also been relaxed to
support symbols, strings, or constants.
2020-03-17 15:07:36 -07:00
Jeff Bonhag
b8ecab1201
Guard against nil Addrinfo objects
On Windows, `Socket.getifaddrs` may return nil if the address is not available in ifaddr.
2020-03-13 17:34:09 -04:00
Jeff Bonhag
d4acdd06ec
Fix #11373: Check all interfaces for port collisions
This commit changes the behavior of the port check to check all possible
IPv4 network interfaces when the host IP is `nil` or `0.0.0.0`. This
means that if the desired port is available on any network interfaces, a
forward from 0.0.0.0 will use that interface.

If the port is open (in use) on all interfaces, then it's treated as a
collision and will either throw an error or auto-correct the port, based
on the Vagrantfile configuration.
2020-03-13 16:30:01 -04:00
Jeff Bonhag
6efdcd2068
Merge pull request #11430 from chrisroberts/winssh-hacks
Fix issues with Windows SSH provisioner (continued...)
2020-03-11 10:39:44 -04:00
Chris Roberts
21e5913cef Explicitly activate vagrant specification when not activated 2020-03-10 15:08:56 -07:00
Chris Roberts
9336ca5529
Merge pull request #11363 from chrisroberts/enhancement/solutions
Add support for caching solutions. Remove GEMRC modifications.
2020-03-10 14:42:28 -07:00
Chris Roberts
bee56a09df
Merge pull request #11366 from dmitrivereshchagin/fix-curl-invocation
Fix use of -q option in curl invocation
2020-03-09 16:53:12 -07:00
Chris Roberts
d96f7c4293 Fix documentation disable in generation hooks 2020-03-09 16:52:39 -07:00