Commit Graph

3403 Commits

Author SHA1 Message Date
Brian Cain a9564b2137 (#8933) Align file provisioner functionality on all platforms
This commit aligns how the file provisioner should work on all host
machines. It ensures that a `/.` is only applied if the user intended
to upload a folder to a destination under a different name. It ensures
that if uploading to a windows guest with a different destination folder
name, it does not nest the source folder under that name so that it
works the same as it does on linux platforms. It also updates the
behavior of the winrm upload communicator by allowing an array of paths
to be uploaded instead of a single file or folder to allow for this new
functionality for windows guests.
2017-08-31 15:57:53 -07:00
Justin Campbell f8fa7e3b29 command/login: Fix typo in server_error 2017-08-30 10:39:58 -04:00
Justin Campbell 3ddc98c2e4 command/login: Support 2FA login on Vagrant Cloud 2017-08-30 10:39:58 -04:00
Justin Campbell 0e091fee16 command/login: Store user/pass on client
Will allow us to prompt for other info without forgetting this data.
2017-08-30 10:39:58 -04:00
Brian Cain 432cb8d915 (#7826) Add salt_arg option for passing flags to salt tool
This commit introduces the salt_arg option that allows a user to pass
additional command line flags to the `salt` tool when provisioning with
a master setup.

It also adds additional config validation to ensure that both
`salt_args` and `salt_call_args` is an array.
2017-08-29 14:11:06 -07:00
Brian Cain 9a29d7be6b (#7836) Introduce salt_call_args option for salt provisioner
This config option for the salt provisioner allows you to pass
additional arguments to the salt-call executable.
2017-08-29 11:17:29 -07:00
Jonathan LaBroad 8e2c66d8a8 Reverting whitespace change 2017-08-29 13:23:53 -04:00
Jonathan LaBroad 8e3831b810 Update default minion version to latest (Python 2)
Perform check to determine to include python version or not
2017-08-29 13:13:24 -04:00
Jonathan LaBroad 384848e92d Adding python_version parameter for Windows minions
Ignoring non-Windows Salt parameters
Get the correct minion file for ver >= 2017.x.x
2017-08-29 12:38:29 -04:00
Dimitrios Kouzis-Loukas 51716c5ef0 fix for issue 8608 2017-08-27 23:56:47 -04:00
Peter Parkkali 8e4f0444e8 Hide duplicate errors in Saltstack provisioner when verbose mode is on 2017-08-26 01:38:06 +02:00
Brian Cain dbc23fccab Merge pull request #8915 from briancain/6656/master/format-windows-paths-for-ssh-config
Format windows paths for ssh_config command
2017-08-25 16:20:32 -07:00
Brian Cain b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Brian Cain 0ac26be4ef (#8917) Fix shell_expand_guest_path capability
Prior to this commit, when the guest capability attempted to expand a
path with spaces it would quote the path passed in. However if the path
also had a relative path those quotes would end up making `printf`
ignore it and not properly expand the path fully. This commit updates
that to first escape the quotes of a path and then pass in the new path
to be expanded.
2017-08-25 10:02:36 -07:00
Chris Roberts 868856b71a Merge pull request #8911 from chrisroberts/fix/compose-hostvm
Error when compose and force_host_vm are enabled together
2017-08-22 12:48:08 -07:00
Brian Cain 9f093f71d9 Merge pull request #8910 from briancain/8479/master/disable-prov-install-global-id-up
Disable install providers when using global id on vagrant up
2017-08-22 12:42:09 -07:00
Chris Roberts f660c19084 Error when compose and force_host_vm are enabled together 2017-08-22 11:36:26 -07:00
Brian Cain d9e088ba5d (#8479) Disable install providers when using global id on vagrant up
Prior to this commit, when using a global id to bring up a vagrant vm,
vagrant would fail during the "install provider" step due to the fact
that the global vagrant machine was not configured for the local vagrant
environment. Since this global vm exists elsewhere, we disable the
install provider step so that vagrant can just bring up the global
vagrant machine.
2017-08-22 10:08:05 -07:00
Brian Cain ea59cfdb92 Merge pull request #8895 from briancain/8697/master/add-ssh-extra-opts
Introduce extra_args setting for ssh configs
2017-08-21 16:26:52 -07:00
Chris Roberts 93f6451261 Retain winssh_ method prefix on auth key helper 2017-08-21 14:48:52 -07:00
Rui Lopes 7fac854cf3 winssh communicator: simplify the authorized_keys file modification 2017-08-21 14:42:18 -07:00
Rui Lopes 4ab0dc19b1 winssh communicator: retain the authorized_keys file acl permissions 2017-08-21 14:42:18 -07:00
Rui Lopes aeac480683 winssh communicator: fix public key insertion 2017-08-21 14:42:18 -07:00
Chris Roberts f32f85595e Merge pull request #8840 from chrisroberts/rsync/ipv6
Format host address for rsync when IPv6
2017-08-21 13:49:58 -07:00
Chris Roberts 1c763cf5e6 Expand relative volume paths for compose on current cwd 2017-08-21 13:26:19 -07:00
Chris Roberts 3f8cbb121a Merge pull request #8837 from chrisroberts/docker-compose/links
Split compose links if string values
2017-08-21 13:21:09 -07:00
Chris Roberts 18d3e5d286 Merge pull request #8831 from chrisroberts/hyperv/ipv6
Update guest IP address discovery for hyper-v guests.
2017-08-21 13:15:06 -07:00
Brian Cain ffec0ff8d9 (#8697) Introduce extra_args setting for ssh configs
Prior to this commit, there was no way to add additional ssh arguments
within a Vagrantfile for a given vagrant machine. This commit introduces
a new option extra_args that allows users to pass in a single argument
or an array of flags that will be added onto the ssh command.
2017-08-17 09:02:20 -07:00
Brian Cain 4bd95cbfe2 (#8864) Improve `vagrant validate` command
Prior to this commit, the `vagrant validate` command would only validate
the first machine in a vagrant file. This commit improves that by
validating all known machines in the environment. If one is not found,
it will properly throw an exception instead of a stacktrace.
2017-08-15 13:53:45 -07:00
Brian Cain c0b54f74ea Merge pull request #8875 from briancain/8716/master/dup-string-if-frozen-for-line-endings
Dup string if frozen for line endings
2017-08-15 10:04:34 -07:00
Brian Cain 0d8f58e5da Merge pull request #8880 from briancain/8603/master/fix-scp-usage-in-file-prov
Ensure remote folder exists prior to scp in file provisioner
2017-08-15 10:04:14 -07:00
Brian Cain 2b8f7f67ea Add unit tests for shell_expand_guest_path function 2017-08-15 09:33:29 -07:00
Brian Cain 01528689fd (#8716) Dup string if frozen for line endings
Prior to this commit, if a user passed in a script that was frozen,
the shell provisioner would fail to modify the script to replace line
endings for windows because the string was immutable. This commit fixes
that by dup'ing the string so that it can have its line endings replaced
2017-08-15 08:38:30 -07:00
Brian Cain 61c501cc65 Ensure paths with spaces are preserved
Prior to this commit, if a user set the `destination` path to include a
space, the `shell_expand_guest_path` function would remove that space
and return a partial path. This commit updates that to quote the path to
be expanded to preserve the entire path.
2017-08-14 15:34:10 -07:00
Brian Cain 335aa35ff4 Merge pull request #8871 from briancain/8719/master/add-force-flag-for-update
Add force flag for box upgrade command
2017-08-14 08:49:46 -07:00
Brian Cain 40eaef08b7 (#8603) Ensure remote folder exists prior to scp in file provisioner
Prior to this commit, if a file provisioner block was ran twice with a
folder on a remote host, due to how scp works, it would first copy over
that folder, and then on the second action it would copy an identical
folder nested within the first one. While this is 'intended' behavior
with scp, it is unexpected behavior for the file provisioner. This
commit updates the file provisioner to first ensure that the directory
to be copied exists on the remote host prior to copying, and then the
destination dir has been changed to the directory that the destination
will be copied to, rather than the exact directly that includes the
folder from the host to prevent the nested folder behavior.
2017-08-11 11:49:39 -07:00
Justin Campbell 03ebd8b714 command/login: Add hostname to default token desc
Uses `Socket.gethostname` to add the current hostname to the default
description.
2017-08-10 17:21:20 -04:00
Justin Campbell 92578aed4b command/login: Add description to created token
This adds a prompt for a token description, which is now supported in
Vagrant Cloud. Pressing enter on the prompt uses the default description
of `"Vagrant login"`.

    $ vagrant login
    In a moment we will ask for your username and password to HashiCorp's
    Vagrant Cloud. After authenticating, we will store an access token locally on
    disk. Your login details will be transmitted over a secure connection, and
    are never stored on disk locally.

    If you do not have an Vagrant Cloud account, sign up at
    https://www.vagrantcloud.com

    Vagrant Cloud Username: justincampbell
    Password (will be hidden):
    Token description (Defaults to "Vagrant login"):
    You are now logged in.
    $

Which created a token with the default description of "Vagrant login":

![](http://c.justincampbell.me/2V0p0T0U0d0O/Screen%20Shot%202017-08-10%20at%205.08.21%20PM.png)

Entering a description:

    Token description (Defaults to "Vagrant login"): Justin's MacBook Pro

![](http://c.justincampbell.me/2m1N0d1M3k3P/Screen%20Shot%202017-08-10%20at%205.09.39%20PM.png)
2017-08-10 17:12:38 -04:00
Taliesin Sisson 3ab64ab7e4 Handle Chef provisioner requests to reboot. A request to reboot is not a convergence failure, so don't treat it like a convergence failure.
Wait for the machine to reboot before trying to continue the provisioning.
2017-08-10 11:39:41 +01:00
Taliesin Sisson 820d80852c If this is called during a shutdown then exception code 1115 is throw. 2017-08-10 11:14:52 +01:00
Brian Cain 324a08bd75 (#8719) Add force flag for box upgrade command
Prior to this commit, if a state was reached where the action_box_add
command needed a force flag, it would fail requesting the user to
provide that flag to override adding a new box. However that flag did
not exist on the box update command, and could not be passed onto the
action_box_add action. This commit updates that to include a force flag,
and if used, pass that value onto the action_box_add action.
2017-08-09 16:21:13 -07:00
Brian Cain 7a7506cd00 (#8789) Remove curl pipe bash install for salt provisioner
Prior to this commit, because of how the bootstrap salt shell file
worked, if github could not be resolved, the installer script would fail
silently with an exit code 0 because `sh` would evalute without any
errors and the curl exit code would be ignored. This commit splits out
the installer to first attempt to save the bash installer, and if it
exists, execute it.
2017-08-09 10:23:13 -07:00
Brian Cain 623b117208 Merge pull request #8682 from Telekom-PD/omnibus-url
Add config option omnibus_url for chef provisioners
2017-08-03 09:19:13 -07:00
Artem Sidorenko 875c2edc62 Add config option omnibus_url for chef provisioners
This option is useful for internal setups, where own customized
omnibus installation script is used (e.g. to get chef from a mirror)
2017-08-03 10:06:27 +02:00
Brian Cain a2d39742a7 Merge pull request #8775 from lucky-sideburn/master
Added exception if chef.node_path is defined on Vagrantfile but the directory does not exist locally
2017-08-01 13:22:23 -07:00
Eugenio Marzo 7e436c6971 fixed warnings about missing folders for Chef Solo and Zero 2017-08-01 21:37:11 +02:00
Chris Roberts 139a65e555 Format host address for rsync when IPv6 2017-07-31 15:44:37 -07:00
Chris Roberts 3b4901a5b5 Split compose links if string values 2017-07-31 14:23:50 -07:00
Chris Roberts 38fed54697 Update guest IP address discovery for hyper-v guests.
Powershell helper script now returns error when guest IP address
cannot be discovered. When reading addresses from a network
device both IPv4 and IPv6 are stored and the IPv4 address has
precedence on returned address.
2017-07-28 10:18:26 -07:00
Chris Roberts 4bc8cc7563 Filter any machine_ip when preparing the NFS settings
When preparing the NFS settings on VirtualBox the guest IP addresses
are pulled from VirtualBox directly and any static addresses are
pulled as well. This can lead to aquiring a host IP and machine IP
but results in a failure of NFS mount because the IPs are not on
the same network. This filters the machine IP result to validate
it is within the host adapter IP range.
2017-07-24 14:02:15 -07:00
Eugenio Marzo c9b65bd129 produce error when node_path is defined but the directory does not exist on disk locally 2017-07-22 11:05:34 +02:00
Eugenio Marzo 94a94648dd change requested after a PR review 2017-07-22 07:58:38 +02:00
Brian Cain 5ee3b0c3b9 Merge pull request #8760 from marblenix/fix/Unable_to_list_network_interfaces_on_FreeBSD
Fix vagrant not being able to list network devices on some FreeBSD boxes.
2017-07-21 14:27:05 -07:00
Brian Cain 4ed93fb9ef (#8743) Fix puppet provisioner by removing manifestdir flag
Prior to this commit, the puppet provisioner would use the manifest dir
flag when running `puppet apply`. Not only is this flag redundant due to
how puppet apply works, but it is also deprecated in Puppet 4 and
removed in Puppet 5. This commit simply removes the flag when invoking
`puppet apply`.
2017-07-19 09:59:59 -07:00
Brian Cain 6fc522a03b Merge pull request #8781 from briancain/fix-rsync-auto-relative-folders
rsync-auto relative dirs from vagrantfile
2017-07-17 10:55:11 -07:00
Brian Cain 773c4fff13 Fixup util/ssh and ansible/provisioner tests 2017-07-17 10:21:26 -07:00
Tomoyuki Sakurai a76dfc7b37 as `key` is a file path, it must be quoted 2017-07-14 10:38:07 -07:00
Tomoyuki Sakurai fe3674e169 another '-i' was used here 2017-07-14 10:34:57 -07:00
Brian Cain 4440056fff (#8770) rsync-auto relative dirs from vagrantfile
Prior to this commit, rsync-auto would not properly rsync realtive dirs
outside the cwd if defined in the Vagrantfile. This commit updates that
to ensure that the command looks at the Vagrant config to ensure that
folder was intended to be rsync'd to the machine even if outside the
current working dir.
2017-07-14 09:26:10 -07:00
Eugenio Marzo 3a5331cbb2 replaced not with ! in the if 2017-07-12 15:32:39 +02:00
Eugenio Marzo dd3d782659 Added exception if chef.node_path is defined on Vagrantfile but the directory does not exist locally 2017-07-12 15:27:10 +02:00
Evgeny Sinelnikov 015d98e76c guests/alt: Fix flavor and network configure with unit tests 2017-07-11 00:35:28 +03:00
Evgeny Sinelnikov 6ef55c172d guests/alt: Adjust flavour detect and restart network after set hostname 2017-07-09 18:16:25 +03:00
Evgeny Sinelnikov 26f7a04b86 hosts/alt: Add hosts capabilities for ALT Linux platforms 2017-07-08 21:36:18 +03:00
Evgeny Sinelnikov 88c0cb855f guests/alt: Update network configuration
Fix network mask to CIDR notation and network configure stop and
restart commands with NetworkManager
2017-07-08 21:30:52 +03:00
Chris Roberts 7e4a34c323 Merge pull request #8761 from chrisroberts/communicator/win-ssh-tmp
WinSSH communicator updates
2017-07-07 11:46:53 -07:00
Chris Roberts cef38eefd0 Add public key capability to Windows guests for winssh communicator 2017-07-07 11:26:32 -07:00
Chris Roberts bcc09e10e6 Make upload directory for winssh communicator configurable
Fixes #8731
2017-07-07 11:04:37 -07:00
Caleb Marble 2aceb03b19 Fix vagrant not being able to list network devices on FreeBSD boxes. 2017-07-07 09:03:38 -05:00
Brian Cain 1bcba57eb7 Merge pull request #8756 from briancain/rsync-auto-docker-provider-fixes
Only rsync-auto current working dir with docker provider
2017-07-06 15:49:34 -07:00
Brian Cain b1548a2eb6 (#5160) Only rsync-auto current working dir with docker provider
Prior to this commit, when users invoked the `rsync-auto` command using
the docker provider with boot2docker, vagrant would rsync all known
containers using the boot2docker vm rather than the current working dir.
This commit updates that behavior to ensure that only the current
working dirs vagrant machines will be rsynced.
2017-07-06 15:05:42 -07:00
Chris Roberts f700b111ce Merge pull request #8695 from jen20/smartos-nfs
guests/smartos: Add/fix various guest capabilities
2017-07-05 15:28:42 -07:00
Evgeny Sinelnikov 3dd90aa955 Add ALT Linux platforms guest detection and support
* ALT Linux platforms is an original rpm based distribution
forked as Mandrake Russian Edition Spring at 2001 year
* Distributions of ALT Linux use etcnet (https://www.altlinux.org/Etcnet) as
internal network configuration system needs for configure_networks support
2017-07-03 00:25:33 +03:00
Brian Cain 864340ec58 Invoke tee from specific path
This commit updates the use of `tee` to use an explicit path when
invoked rather than relying on where `tee` has been defined in a users
PATH.
2017-06-29 16:11:18 -07:00
Brian Cain 0225d63055 Merge pull request #8722 from briancain/add-post-setup-proc-for-docker
Add post-install provisioner to docker provisioner
2017-06-28 08:32:23 -07:00
Brian Cain a05d95bd0a (#7139) Add post-install provisioner to docker provisioner
Prior to this commit, if a user attempted to configure
`/etc/default/docker` through vagrant prior to installation, the package
manager would not override an existing configuration and installing
docker would then fail. This commit fixes this by introducing a
`post_install_provisioner` that allows users to define a provisioner
block that will run after docker has been installed, allowing users to
configure `/etc/default/docker` how they want.
2017-06-27 16:01:23 -07:00
Chris Roberts 138408ab7c Merge pull request #8710 from chrisroberts/enhancement/atlas-to-vc
Updates for Vagrant Cloud
2017-06-26 16:43:44 -07:00
Chris Roberts 5f955c3d38 Convert atlas references to vagrant cloud 2017-06-23 10:01:51 -07:00
Dimitrios Kouzis-Loukas 34d8ffb9b2 Fixing vagrant ssh issue 8705
Fixing vagrant issue https://github.com/mitchellh/vagrant/issues/8705
2017-06-21 10:23:34 -04:00
Chris Roberts 8437dccca2 Merge pull request #8678 from caveman-dick/fixWindow2012R2Issue
Fixes #8677 - Detect the result of the has_vmcx_support.ps1 properly
2017-06-19 16:51:46 -07:00
Chris Roberts b3365af4b8 Merge pull request #8666 from louy2/patch-1
Chomp lookup gid
2017-06-19 16:45:04 -07:00
Chris Roberts c5b3751a83 Properly handle exception raised when property does not exist 2017-06-19 14:04:57 -07:00
James Nugent b0b9d044b5 guests/smartos: Add/fix various guest capabilities
This commit adds a variety of fixes for SmartOS guest support:

- Host name setting now works in the global zone and in non-global zones
- NFS now works in the global zone and the non-global zone.
- Tests are updated and moved to the (apparently) more modern style
2017-06-16 17:00:50 -04:00
Yufan Lou b8bad54ad9 Fix nil case 2017-06-16 11:22:56 +08:00
Brian Cain fbda3af106 Merge pull request #8693 from briancain/7855/master/introduce-more-ssh-config-options
Introduce more ssh options for machines
2017-06-15 16:38:18 -07:00
Brian Cain b02f110cd8 (#7855) Introduce more ssh options for machines
This commit allows the user to configure two additional options that
were previously not configurable: Compression and DSAAuthentication.
Each config option is set as a boolean, and if left out of the config
will default to its previous behavior which is included and set to
"yes". If the user explicitly sets it to false, it will not be included
as an ssh option.
2017-06-15 16:29:53 -07:00
Chris Roberts d260fe7d38 Merge pull request #7865 from DavidWittman/7454-fix-salt-minion-id-config
Fix minion_id config for salt provisioner
2017-06-15 16:01:33 -07:00
Richard Gareau 056f837fed Do not use UNC path for Solaris guest on Windows 2017-06-15 15:15:39 -07:00
Chris Roberts 6906dbc558 Merge pull request #8467 from MartinNowak/patch-1
fix `config.ssh.keys_only = false` for ansible
2017-06-14 16:54:24 -07:00
Chris Roberts 12e63de542 Merge pull request #8553 from bdwyertech/kali
Add support for Kali Linux
2017-06-14 16:47:32 -07:00
Chris Roberts 60a438396f Merge pull request #8588 from aligenttimaslat/bugfix/rsync_mkdir_on_windows
Fix a problem when using rsync folders on windows clients
2017-06-14 16:41:36 -07:00
Chris Roberts 3f8172d874 Merge pull request #8618 from jen20/smartos-guests
guests/smartos: Add/fix various guest capabilities
2017-06-14 16:33:46 -07:00
Chris Roberts fe10b45cdb Merge pull request #8659 from HarryWeppner/docker-compose-check
fix `docker-compose` check on `PATH`
2017-06-14 15:24:25 -07:00
Andreas Olsson f6a9dcdd6f Catch pip_args in FreeBSD's and SUSE's ansible_install
While neither the FreeBSD provisioner nor the SUSE provisioner support
installing Ansible using pip their ansible_install methods still get
called with that fourth argument. The result being these errors when
Vagrant tries to install Ansible.

    /opt/vagrant/embedded/gems/gems/vagrant-1.9.5/plugins/provisioners/ansible/cap/guest/freebsd/ansible_install.rb:10:in `ansible_install': wrong number of arguments (4 for 3) (ArgumentError)
    /opt/vagrant/embedded/gems/gems/vagrant-1.9.5/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb:9:in `ansible_install': wrong number of arguments (4 for 3) (ArgumentError)

The Arch provider, it too without pip support, already catches the
pip_args argument this way.
2017-06-14 21:01:44 +02:00
Brian Cain 3baa142e7c (#7685) Add a unique identifier to provision objects
Prior to this commit, Vagrant had no way internally to determine if a
provisioner object was unique if the `name` property was not set.
Because of this, when vagrant went to merge configs it would duplicate
an existing unnamed provisioner since it had no way of determining if a
user actually had added the same provisioner twice. This commit fixes
that by introducing an id which will default to `name` if its set, but
if not will be set by `SecureRandom.uuid`.
2017-06-13 15:46:14 -07:00
Richard Mayes 649fea13ff Detect the result of the has_vmcx_support properly
Fixes #8677
2017-06-13 18:20:48 +01:00
Brian Cain 6f21a19649 Merge pull request #8661 from briancain/6640/master/use-cipher-list-for-ssh-communicator
Use default cipher list for ssh communicator
2017-06-12 09:39:20 -07:00
Yufan Lou 3b63e1f8b8 Add chomp to lookup gid
Fixes #8664
2017-06-10 15:15:43 +08:00
Brian Cain 7a97f0a53e (#6640) Use default cipher list for ssh communicator
Prior to this commit, the ssh communicator would use the default cipher
list in Net::SSH to negociate which ciphers it should use between hosts.
Due to a bug in Net::SSH and the position of the `none` cipher in its
default cipher list, if a host supported the none cipher, but also
only supported other ciphers that came after none in the default list,
it would accept none and attempt to use that cipher instead of the other
supported ciphers. This commit fixes that behavior by copying the
default cipher list from Net::SSH and placing none last in the list so
that other ciphers can be used in the negotiation before attempting to
use the unsecure none cipher.
2017-06-09 17:18:15 -07:00
Harry Weppner 250e74cb79 fix check for `docker-compose` 2017-06-08 11:09:41 -07:00