Commit Graph

1001 Commits

Author SHA1 Message Date
Mitchell Hashimoto d3bcc4e5f9 Merge pull request #6213 from jrob/winrm-execution-timeout
Winrm execution timeout
2015-11-18 13:00:59 -08:00
Mitchell Hashimoto e6098f6c4f rename to powershell_elevated_interactive 2015-11-18 12:51:18 -08:00
Mitchell Hashimoto 37940e7350 Merge pull request #6185 from marc-ta/elevated_interactive
Elevated interactive
2015-11-18 12:46:39 -08:00
Mitchell Hashimoto fedc7e21b3 provisioners/salt: deprecate config_dir 2015-11-18 11:56:07 -08:00
Mitchell Hashimoto f1827602f2 Merge pull request #6502 from dmacvicar/fix-dhcp-on-suse
SUSE-flavored systems use STARTMODE and not ONBOOT
2015-11-18 11:05:36 -08:00
Seth Vargo ff95fc5c1e Only append access_token the first time
This fixes GH-6395 by only appending the access_token once. It also fixes a
bug that was never reported. If a user supplied an access_token for a box URL,
Vagrant would silently overwrite it.

After this commit, Vagrant only appends an access_token to the URL if no
value exists at the key.
2015-11-18 10:44:35 -08:00
Duncan Mac-Vicar P a21d5be705 SUSE-flavored systems uses STARTMODE and not ONBOOT
As described in /etc/sysconfig/network/ifcfg.template

Static template was already using the right one, but the dhcp configuration seems
to be copied from a Fedora/Redhat template.
This fixes the issue that the interface does not come up after reboot.
2015-11-08 16:09:04 +01:00
Gilles Cornu a3c077cbe0 Merge branch 'gildegoma/ansible-force-ssh-user'
Resolved conflicts in
  plugins/provisioners/ansible/config.rb
  plugins/provisioners/ansible/provisioner.rb
  test/unit/plugins/provisioners/ansible/provisioner_test.rb
  website/docs/source/v2/provisioning/ansible.html.md

ref #6348
2015-11-08 14:01:23 +01:00
Gilles Cornu 9bfdaf7e75 provisioners/ansible: introduce ansible_local
With this change, the existing host-based Ansible provisioner is
refactored to share a maximum of code with this new guest-based Ansible
provisioner.

At this stage of development, the existing unit tests are intentionally
modified as little as possible, to keep safe the existing funtionalities.

Other issues resolved by this changeset:
 - Display a warning when running from a Windows host [GH-5292]
 - Do not run `ansible-playbook` in verbose mode when the `verbose` option
   is set to an empty string.
2015-11-08 10:42:48 +01:00
Mitchell Hashimoto 69d9bc0fe8 Environment can_install_provider and install_provider 2015-11-05 11:50:10 -08:00
Mitchell Hashimoto 72e13ee9ef test: add tests for provider command 2015-11-04 14:26:22 -08:00
Gilles Cornu dde94a3ce7 provisioners/ansible: add force_remote_user option
The benefits of the following "breaking change" are the following:
- default behaviour naturally fits with most common usage (i.e. always
  connect with Vagrant SSH settings)
- the autogenerated inventory is more consistent by providing both the
  SSH username and private key.
- no longer needed to explain how to override Ansible `remote_user` parameters

Important: With the `force_remote_user` option, people still can fall
back to the former behavior (prior to Vagrant 1.8.0), which means that
Vagrant integration capabilities are still quite open and flexible.
2015-11-02 09:03:15 +01:00
Mitchell Hashimoto 32e981ce7c core: machine-readable output should include standard UI output
As a "ui" type
2015-10-26 18:10:26 -07:00
Dan Dunckel 9d87be51da Small refactor on conditional check and add tests 2015-10-15 12:25:50 -07:00
Seth Vargo c88d52082a Merge pull request #6296 from tomfanning/master
Hyper-V set mac address
2015-10-14 13:02:53 -04:00
Mitchell Hashimoto 5e48d35911 Merge pull request #6229 from mitchellh/b-winrm-info-respect-timeout
communicators/winrm: respect boot_timeout when fetching winrm_info
2015-10-12 15:50:05 -04:00
Mitchell Hashimoto 06f8595bc0 kernel/v2: clone option 2015-10-08 11:59:09 -04:00
Mitchell Hashimoto ec0326f1c8 Merge pull request #6377 from mitchellh/f-cap-command
"cap" command
2015-10-08 10:52:14 -04:00
Mitchell Hashimoto 99d29f17fa commands/cap 2015-10-08 10:35:36 -04:00
Mitchell Hashimoto 31ae00cfc3 test: more tests for snapshots 2015-10-08 09:10:55 -04:00
Mitchell Hashimoto cc8cdafdc3 test: test for IsEnvSet 2015-10-07 22:54:27 -04:00
Mitchell Hashimoto 199a58fdd9 test: test IPv6 2015-10-01 08:47:25 -04:00
Mitchell Hashimoto 7e18a92bd9 test: fix tests 2015-10-01 08:45:44 -04:00
Mitchell Hashimoto ec0b0fb7f9 providers/virtualbox: IPv6 host only networks 2015-09-30 17:23:25 -07:00
tomfanning 41beaac074 Hyper-V set mac address 2015-09-22 11:35:55 +01:00
Sam Phippen 379dcfa568 Add a failing test for #6065 2015-09-12 14:31:49 +01:00
Sam Phippen eeb750cd33 Catch encoding problems with sources provided to Vagrant::Config::Loader#set
Here we implement a naive solution to #5605 which catches the case that
a provided source contains an object which cannot be inspected, because
an object contained within in has an #inspect string that returns a
string that is incompatible with the encoding in
`Encoding.default_external` or a string which cannot be downcast to
7-bit ascii.

The Ruby VM implementation of "#inspect" implements this checking on
these lines of code: http://git.io/vZYNS. A Ruby level override of
this method does not cause this problem. For example:

```ruby
class Foo
  def inspect
    "😍".encode("UTF-16LE")
  end
```

will not cause the problem, because that's a Ruby implementation and the
VM's checks don't occur.

However, if we have an Object which **does** use the VM implementation
of inspect, that contains an object that has an inspect string which
returns non-ascii, we encounter the bug. For example:

```ruby
class Bar
  def inspect
    "😍".encode("UTF-16LE")
  end
end

class Foo
  def initialize
     @bar = Bar.new
  end
end

Foo.new.inspect
```

Will cause the issue.

The solution this patch provides basically catches the encoding error
and inserts a string which attempts to help the user work out which
object was provided without blowing up. Most likely, this was caused
by a user having a weird encoding coming out of one of the sources
passed in, but without a full repro case, it's not clear whether a patch
should be applied to a different object in the system.

Closes #5605.
2015-09-08 17:30:50 +01:00
Sam Phippen 790fa9f8e2 Add a failing test for #5605 2015-09-08 17:15:51 +01:00
Paul Hinze 1e84cc4d6a communicators/winrm: respect boot_timeout when fetching winrm_info
We gained a ton of improvemnts to WinRM error handling in
https://github.com/mitchellh/vagrant/pull/4943, but we also got one bug.

The new code raises an exception when `winrm_info` does not return right
away. This was preventing us from catching the retry/timout logic that's
meant to wait until boot_timeout for the WinRM communicator to be ready.

This restores the proper behavior by rescuing the WinRMNotReady
exception and continuing to retry until the surrounding timeout fires.
2015-09-02 16:36:23 -05:00
Jeremy Roberts 44154c92a9 Fixing WinRM communicator unit test. 2015-08-31 11:42:34 -04:00
konomae ad9a7324c5 Fix invalid ini entry error when ansible_ssh_private_key_file contains spaces 2015-08-29 18:00:20 +09:00
Gilles Cornu faeb8a9440 core: plugin management requires bundler
With this change, the `Vagrant::plugins_enabled?` is now false when the
embedded Bundler is not available.

Resolve the broken RSpec unit tests after
479323f1e8.
2015-07-10 13:37:33 +02:00
Gilles Cornu 3842a1f710 provisioners/ansible: provide ssh identities via ANSIBLE_SSH_ARGS (when necessary)
When provisioning multiple machines in sequence (the default vagrant
behaviour), it doesn't make sense to require to provide the private ssh
key(s) via the custom ansible inventory script/file.

To align with the handling of multiple ssh keys per machine, we won't
rely any longer on `--private-key` command line argument, but only pass
the keys via `ANSIBLE_SSH_ARGS` environment variable.

Note that when vagrant generates the ansible inventory and that only one
key is associated to a VM, this step would be redundant, and therefore
won't be applied.

This change fixes the breaking change introduced by 3d62a91.
2015-07-10 08:51:17 +02:00
Luis Pabón 76651a413d provisioners/ansible: Update unit tests
Signed-off-by: Luis Pabón <lpabon@redhat.com>
2015-07-10 08:51:17 +02:00
Seth Vargo d72306b6d5 Fix command builder tests 2015-07-09 21:36:50 -06:00
Seth Vargo 06dcd55f57 Fix tests 2015-07-09 16:59:17 -06:00
Mitchell Hashimoto cea44847de Merge branch 'filter_synced_folders' of https://github.com/maxlinc/vagrant into maxlinc-filter_synced_folders 2015-07-09 15:05:52 -06:00
Mitchell Hashimoto e903988461 fix tests 2015-07-09 14:14:30 -06:00
Seth Vargo d8d5a66fa5 Add a function to get to the "original" environment with Vagrant
This function only works when used with the official Vagrant installer.
2015-07-09 12:34:04 -06:00
Mitchell Hashimoto c1508cd893 kernel/v2: customizable sudo_command [GH-5573] 2015-07-09 09:30:47 -06:00
Mitchell Hashimoto 606a8fdde2 providers/docker: validate create args is list [GH-4850] 2015-07-08 10:25:32 -06:00
Mitchell Hashimoto c2cae80de5 providers/dock: pull image prior to starting 2015-07-08 10:09:15 -06:00
Gilles Cornu 839a2e6fa6 provisioners/ansible: show ansible-playbook only when the verbose option is enabled
Revert 1c884fa4e5 which introduced the
following bug:

Instead of allowing to dump the `ansible-playbook` command details when
VAGRANT_LOG=debug was defined, it was then impossible to disable this
console output when VAGRANT_LOG was undefined (in such case,
``@logger.debug? systematically returns `true`)

In order to keep things simple and focused, it is preferable to drop the
bad idea to mix Ansible verbosity and Vagrant log level.

Fix #5803
2015-07-07 22:37:06 +02:00
Mitchell Hashimoto 9c7f666e48 provisioners/docker: support restart flag [GH-4477] 2015-07-07 12:17:24 -06:00
Mitchell Hashimoto 1330244fef core: save the UID that created a machine 2015-07-06 18:04:16 -06:00
Mitchell Hashimoto 0de0f51e8a fix tests 2015-07-06 17:44:40 -06:00
Mitchell Hashimoto 6c06db776d core: test for URI escaping 2015-07-06 16:26:06 -06:00
Mitchell Hashimoto 341534299d core: ssh private_key_path overwrites insecure key [GH-5632] 2015-07-06 16:17:54 -06:00
Mitchell Hashimoto bd0626672b Merge pull request #5818 from mitchellh/issue-5790-password-in-cleartext
provisioner/shell: remove plaintext auth from Windows powershell
2015-07-06 15:21:47 -06:00
Mitchell Hashimoto f5e38a4a14 kernel/v2: not an error if synced folder guest path is empty [GH-4833] 2015-07-06 14:58:48 -06:00