824 Commits

Author SHA1 Message Date
sophia
d500daea03 Support centos flavors of redhat 2020-04-03 14:27:44 -04:00
sophia
9d53e8ccab Recognize rhel8 flavor 2020-03-25 10:36:02 -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
7d44fef00e
Merge pull request #11428 from chrisroberts/fix/windows-reboot
Catch any StandardError exception while waiting for Windows reboot
2020-03-09 16:48:27 -07:00
Chris Roberts
7c2083d5da Update how delayed actions are stored to avoid accessing uninitialized value 2020-03-05 13:25:57 -08:00
Chris Roberts
ec9d23a531 Update public key cap to use powershell 2020-03-04 15:08:03 -08:00
Jeff Bonhag
df7c11a3a7 Fix issues with Windows SSH provisioner
Windows commands that run over SSH are wrapped in a script that writes a
special marker to the two output streams (stdout and stderr).  This
allows Vagrant to consume the output streams.

Unfortunately, this leads to a sort of chicken-and-egg problem where no
commands can be run before a wrapper script exists. For example, you
can't make a destination directory to upload the wrapper script without
first creating a wrapper script to make the directory. :)

This commit changes the behavior of the WinSSH communicator to assume
that the destination directory already exists for provisioning scripts.

It also moves the default `upload_path` from the shell provisioner
config so we can have OS-specific defaults.

Finally, it introduces a Windows-specific #upload method which will
properly use a Windows path separator on a non-Windows host.
2020-03-04 15:08:03 -08:00
Chris Roberts
6f707c829d Catch any StandardError exception while waiting for Windows reboot
This prevents any unexpected connection related error from breaking
the wait loop while windows reboots. If an underlying problem unrelated
to the guest is causing exceptions, the exception will still be raised
to the user, simply after the loop has exceeded the defined maximum
wait time.

Fixes #11238
2020-03-03 17:02:04 -08:00
Chris Roberts
660166720b Update delayed execution implementation to utilized appended action hook 2020-03-03 16:23:31 -08:00
Chris Roberts
25659a6f6b Support properly setting up synced folders on Catalina
Since the root file system is marked as read-only, attempting to
link the shared directory to `/vagrant` will fail. If the guest
path is on the root file system and APFS is used, create the
link as a firmlink instead.
2019-12-18 13:11:30 -08:00
Jeff Bonhag
2fa44f5b8f
Fixes #11218: Update apk cache when installing rsync (#11220)
This ensures that rsync can be installed on an Alpine Linux machine where the
apk cache may not be current.

Display a warning if the vagrant-alpine plugin is installed, since Alpine guest
support has been merged into Vagrant core.
2019-12-17 12:34:53 -05:00
Brian Cain
fb7a9d5582
Remove trailing whitespace 2019-11-21 13:44:28 -08:00
Tomas Krizek
3519f82b24
guest/redhat: fix nfs client installation
CentOS 8+ and Fedora 30+ no longer have the alias "nfs" for "nfs-server"
systemd service.

This shouldn't break backward compatibility, since "nfs-server" service
is available on all supported redhat systems that have systemctl binary.

Fixes #10838
2019-11-21 13:11:29 -08:00
Jeff Bonhag
307123c1f2
Fixes #10753: Add reboot support for Linux guests (#11194)
This commit adds support for setting `reboot: true` while using the
shell provisioner with Linux guests.
2019-11-15 14:46:36 -05:00
Christoph Moench-Tegeder
6f6e58f4ae explicitly test the hostname we'll be setting
getent queries the system resolver for the hostname - but it's not
the resolver we're interested in. In fact, the hostname-to-be-set
may already exist in DNS (becuase DNS really is a nifty thing and
can do a lot of things which are not that possible with /etc/hosts
alone), in which case getent will "not fail" and vagrant will believe
the hostname had already been set.
Instead, query hostnamectl for the "static" hostname - that's the
one we will be setting, so we're ok IFF hostnamectl returns exactly
what we would be setting.
2019-11-01 15:41:04 +01:00
Brian Cain
00e0dc9279
Merge pull request #11076 from dcermak/suse_nfs_support
Update nfs & service daemon names for suse based hosts
2019-10-08 13:41:22 -07:00
Brian Cain
ea550289a9
Merge pull request #11100 from chkpnt/suse-hostname
Use hostnamectl instead of hostname to set the hostname under SUSE
2019-10-08 09:26:46 -07:00
Gregor Dschung
8442b6b59f Use hostnamectl instead of hostname to set the hostname under SUSE 2019-10-03 14:46:14 +02:00
Rui Lopes
ba71c30e04 retry the wait for a windows reboot on connect timeout errors 2019-09-28 12:20:10 +01:00
Dan Čermák
a3588c28a8
Update nfs & service daemon names for suse based hosts
- nfs.service got recently removed in openSUSE Tumbleweed and calling service
  restart nfs errors out on Tumbleweed. nfs.service has been an alias to
  nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
  => no reason not to use systemctl
2019-09-18 23:28:18 +02:00
Ladar Levison
690963669c Added fall through logic with error messages if OS is unrecognized.
This will print an error message but still exit with 0 if an
ephemeral hostname change was made, which seems more defenisve,
and user friendly to me.
2019-08-03 20:59:41 +05:30
Ladar Levison
53323ba54e Fix the hostname config logic for Alpine.
And allow those who like `vagrant` to go
Alpine skiing!
2019-08-03 15:19:51 +05:30
Tim Schumacher
39fb585295 alpine: Remove unneeded aliases in change_host_name 2019-07-26 08:32:36 +02:00
Tim Schumacher
a7f09f010c alpine: Convert nfs_client capability to seperate commands
The workaround for the broken repository should be safe to be removed,
since the last affected Alpine version (<=3.3) EOL'd in November of 2017.

The remaining important commands can be split out into seperate calls
of sudo(), which removes the need for manual exit-code checking
(since it aborts by itself when a command fails) and makes the code
easier to handle in general.
2019-07-26 08:31:12 +02:00
Tim Schumacher
77616b22b3 alpine: Use absolute paths for network configuration templates 2019-07-18 04:07:15 +02:00
Tim Schumacher
3b03944331 alpine: Replace capability strings with symbols
Those were introduced upstream in b29864f45097.
2019-07-18 03:35:48 +02:00
Tim Schumacher
2216d23048 alpine: Remove version and out-of-tree checks 2019-07-18 03:35:48 +02:00
Tim Schumacher
fbffb41fc4 guests: Add unmodified alpine support plugin from maier
This has been available as `vagrant-alpine` in the plugin
repository so far.
2019-07-18 03:35:40 +02:00
Brian Cain
8e9578cf5d
Merge pull request #10752 from chrisroberts/f-coreos-guest-caps
Update guest capabilities for coreos
2019-04-09 15:10:58 -07:00
Jose Luis Duran
93f02c67f8
FreeBSD: Simplify the listing of interfaces
According to ifconfig(8), to list only Ethernet interfaces, excluding
all other interface types, including the loopback interface, the command
to use should be:

    ifconfig -l ether

Related to: #8760
2019-03-29 02:47:39 -03:00
Jose Luis Duran
1cf0e62400
BSD: VirtualBox shared folders naming convention
This is a follow-up of #10717 to use the same naming convention as on
Linux guests, in order to reduce the diffs.

Also adds the missing capability to `unmount_virtualbox_shared_folder`
on FreeBSD guests.
2019-03-28 02:34:34 -03:00
Chris Roberts
0575fdfd69 Do not rely on IPAddr#prefix as it's not available on older rubies 2019-03-22 16:42:30 -07:00
Chris Roberts
8ba69e587c Update guest capabilities for coreos 2019-03-22 15:20:37 -07:00
Brian Cain
2f0c66f832
Only enable shared folder mounts on freebsd guests
Since the virtualbox guest additions seem to only be available for
freeBSD, move the shared folder functionality over to freebsd guests
rather than all BSD guests.
2019-03-08 11:03:23 -08:00
Brian Cain
b2251d5bec
Update logger to display vboxvfs module rather than vboxsf
Ensure the logger displays the right vbox module used for mounting
shared folders
2019-03-07 10:49:38 -08:00
Brian Cain
0bfca8293a
Update from vboxsf to vboxvfs
BSD guests use vboxvfs module for mounting share folders
2019-03-07 10:35:37 -08:00
Brian Cain
554b096961
Fixes #8884: Introduce proper VirtualBox shared folders for BSD
This commit adds proper VirtualBox shared folder support for BSD guests.
It is essentially a copy of the linux capability.
2019-03-07 10:35:37 -08:00
Chris Roberts
927364652f
Merge pull request #10595 from danowar2k/master
- FIX for #10594
2019-02-26 14:09:31 -08:00
Chris Roberts
ade5370db3 Add reboot output to guest capability 2019-02-01 15:47:02 -08:00
Daniel Poggenpohl
2d9ba0e906 - FIX for #10594 (more logical flow) 2019-01-17 14:59:52 +01:00
Daniel Poggenpohl
d565f628fd - FIX for #10594 2019-01-17 14:21:53 +01:00
Brian Cain
65a7261853
Fixes #10585: Properly set DHCP for systemd-networkd ips
Prior to this commit, if a debian system requested an DHCP address using
systemd-network, Vagrant would ignore it and instead use the configured
IP from the virtualbox network action. This commit fixes that by instead
looking if DHCP was requested, and if so, use that option for an IP.
2019-01-11 10:19:37 -08:00
Iku Iwasa
982534aaed Fix grep command for network interface of CoreOS guest 2019-01-04 00:25:35 +09:00
Chris Roberts
9f1e7d9895 Prevent nil dup as unsupported in 2.3 2018-12-20 07:43:43 -08:00
Chris Roberts
a4a98d97fc Fix guest network configuration by properly extracting extra options
Extra options are extracted from the machine configuration for the
network being configured to allow for customized network manager
behavior. The network entries must be filtered to remove non-network
entries (like port forwards) before accessing by index.

Fixes #9546
2018-12-19 16:08:47 -08:00
Brian Cain
796ff7b190
Remove logger from windows hostname cap 2018-11-05 14:12:16 -08:00
Brian Cain
377b900277
Only execute reboot check if guest communicator is ready 2018-11-02 16:33:36 -07:00
Brian Cain
142a6898bc
Add reboot cap for windows
This commit introduces a proper reboot cap for Windows guests. Once it
initiates a reboot on the guest, it calls out to the wait_for_reboot cap
to block on until the guest is finished rebooting.
2018-11-02 15:25:57 -07:00
Brian Cain
54c8ebc31a
Fixes #10229: Add timeout for changing hostname on windows
Prior to this commit, if Windows was slow to reboot, Vagrant would fail
to find the right IP address to upload the wait_for_reboot script to.
This commit fixes this race condition by adding a timeout to ensure that
Vagrant can retry. It also properly catches an exception in the winrm
ready? method for checking if a guest is properly ready for
communications.
2018-11-02 09:23:00 -07:00
Brian Cain
a1bb7b837a
Use semicolon over ampersand to separate commands 2018-10-24 15:27:33 -07:00