Commit Graph

78 Commits

Author SHA1 Message Date
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
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
Jose Luis Duran 53acd20548
Fix network configuration on FreeBSD hosts
There was a missing space within `sed` parameters that caused the
`rc.conf` file to be wrongly created as `rc.conf-e`.
2018-04-19 16:25:16 -03: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
Brian Cain 2b8f7f67ea Add unit tests for shell_expand_guest_path function 2017-08-15 09:33:29 -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
Caleb Marble 2aceb03b19 Fix vagrant not being able to list network devices on FreeBSD boxes. 2017-07-07 09:03:38 -05:00
Chris Roberts e62d71b645 Remove comment removal from /etc/hosts file on guests
Fixes: #7794
2017-04-20 17:07:56 -07:00
Chris Roberts 185a7dfc2e guests/rsync do not chown files excluded from sync 2016-08-16 15:13:19 -07:00
Seth Vargo 72dcf610f7
guests/freebsd: Escape guest path in rsync folders 2016-07-18 21:12:59 -04:00
Seth Vargo cf91bcf029
guests: Always search for FQDN without sudo 2016-07-18 21:12:54 -04:00
Seth Vargo ea9b28f9b6
guests/freebsd: Check FQDN for hostname 2016-07-18 21:12:52 -04:00
Seth Vargo 07e6d0e707
guests/bsd: Centralize logic for halting guests 2016-06-18 15:06:20 -04:00
Seth Vargo 079acb42cd
guests/bsd: Centralize logic for public key management 2016-06-17 21:36:28 -04:00
Seth Vargo 6284a9ac50
guests/bsd: Move NFS mounting logic into shared
A number of the BSD guests used very old mounting options or just
ignored some parameters entirely. This fixes that.

- Closes #7474
- Fixes #7466
2016-06-17 21:04:23 -04:00
Seth Vargo 0c268f7b3f
guests/bsd: Add shared BSD guest for common behavior 2016-06-17 20:16:36 -04:00
Seth Vargo b29864f450
Use symbols for defining guest capabilities 2016-06-17 19:55:04 -04:00
Seth Vargo add40534de
Use strip instead of chomp 2016-06-16 15:32:11 -04:00
Seth Vargo d07cb9d75e
guests/freebsd: Use require_relative 2016-06-06 11:58:31 -04:00
Seth Vargo cf74347980
guests/freebsd: Install rsync in one command 2016-06-06 11:58:30 -04:00
Seth Vargo de64bd03de
guests/freebsd: Mount NFS folders in a single command 2016-06-06 11:58:30 -04:00
Seth Vargo bf51f6a71d
guests/freebsd: Insert public key in one command 2016-06-06 11:58:30 -04:00
Seth Vargo 7806223020
guests/freebsd: Add tests to halt capability 2016-06-06 11:58:30 -04:00
Seth Vargo 2b08151977
guests/freebsd: Configure predictable networks in a single command
This commit refactors the freebsd networking to:

1. Use predictable network naming
2. Properly handle DHCP vs static networks on up and reload [GH-5852]
3. Perform all networking configuration in a single command to prevent
   partial configuration.
2016-06-06 11:58:29 -04:00
Seth Vargo a444110993
guests/freebsd: Configure hostname in a single command
This updates freebsd to set the hostname in a single command and prepend
the hostname to the /etc/hosts file.
2016-06-06 11:58:29 -04:00
Seth Vargo 49ce775b53
Prefix tempfiles with vagrant- 2016-05-31 00:18:16 -04:00
Seth Vargo 7014aa3bab
Remove custom tempfile class
This is not actually providing any additional utility and also causes
namespace conflicts with people trying to use the real Tempfile class.
2016-05-30 23:21:47 -04:00
Seth Vargo 5a4f345363
Use Util::Tempfile when configuring networks
This fixes a fairly large tempfile leak. Vagrant uses a template
renderer to write network configuration files locally to disk. Then,
that temporarily file is uploaded to the remote host and moved into
place. Since Vagrant is such a short-lived process, GC never came along
and cleaned up those tempfiles, resulting in many temporary files being
created through regular Vagrant usage.

The Util::Tempfile class uses a block to ensure the temporary file is
deleted when the block finishes. This API required small tweaks to the
usage, but provides more safety to ensure the files are deleted.
2016-05-28 23:22:34 -04:00
Andres Montalban 492ba40fd1 [MOD] Change the way FreeBSD network interfaces are configured. Fixes #5852 2016-03-01 19:28:09 -03:00
Seth Vargo e7ff8df256 Merge pull request #6867 from jlduran/freebsd-hostname-string
FreeBSD: Use quotes around hostname in rc.conf
2016-02-03 09:59:11 -05:00
Jose Luis Duran 0844b49c7a FreeBSD: Use quotes around hostname in rc.conf
Use double quotes around the hostname value in /etc/rc.conf
2016-01-13 07:28:42 -02:00
Peter Souter b3dd933afd Change to use pkgng
Old pkg_* is now EOL: https://lists.freebsd.org/pipermail/freebsd-ports-announce/2014-February/000077.html
2015-12-29 14:35:49 +00:00
Michael Adam b43413525f guests/freebsd: fix call of set -i : missing extension
Sed on freebsd seems to be mores strict than on other
platforms about use of -i: the extension is not optional.

Signed-off-by: Michael Adam <obnox@samba.org>
2015-03-23 13:31:07 +01:00
Seth Vargo d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Michael Dwyer e65ae7b543 Add back creation of mount point
Accidentally removed in ad4b30dd
2014-12-10 10:56:30 -06:00
Mitchell Hashimoto 5418e6b85e guests: add remove_public_key to most guests 2014-10-24 10:05:01 -07:00
Mitchell Hashimoto 4c0aa0d9cb update CHANGELOG 2014-10-23 10:04:58 -07:00
Matthias Breddin d4b30dd12a Allow nfs 2014-09-18 17:14:13 +02:00
Mitchell Hashimoto 9e5a2d28c6 Merge pull request #4308 from Voxer/fix/master/issue4307
guest/freebsd: fix interface device names in /etc/rc.conf
2014-08-29 09:54:31 -07:00
Leo Simons fec14cf04c Use -f argument to rm to force-remove files.
When using pty=true, removing files using sudo may request confirmation,
which will hang the connection.

Similarly, sometimes assumptions about file existence may be wrong and
in those cases it seems better to continue on as long as the file does
not exist, so -f makes sense there, too.
2014-08-29 10:51:31 +02:00
Kostyantyn Fomin c43ab95f86 Fix Issue 4307: FreeBSD fix interface device names in /etc/rc.conf
https://github.com/mitchellh/vagrant/issues/4307

Fix details:
Pass network interface name to template renderer and use it
in static and dhcp templates to render /etc/rc.conf entries.

  modified:   plugins/guests/freebsd/cap/configure_networks.rb
  modified:   templates/guests/freebsd/network_dhcp.erb
  modified:   templates/guests/freebsd/network_static.erb

Verification scenario:
Check if /etc/rc.conf contains vtnet entries when paravirtualized
NIC devices are used in FreeBSD guest.
2014-08-06 14:10:05 -07:00
Mitchell Hashimoto 4d76327382 guests/freebsd: style 2014-06-12 11:38:53 -07:00
Calvin Hendryx-Parker eda1ac5667 Updated the rsync freebsd plugin install process for FreeBSD 10 2014-06-10 15:07:50 -04:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto 34b7cace7b synced_folders/rsync: rsync__chown [GH-3810] 2014-05-17 12:01:50 -07:00
Trey Hyde ca986455f3 guests/freebsd: Properly register that the rsync_pre capability belongs to FreeBSD rather than defining re-defining it for Linux. 2014-05-13 18:07:35 -07:00
Teemu Matilainen f87c7a9bc9 synced_folders\rsync: remove non-portable '-v' flag from chown [GH-3743]
Aside of the already fixed OpenBSD, at least Solaris `chown` seems not
to support the `-v` option, so remove it from all guests.
2014-05-10 23:51:12 +03:00
Mitchell Hashimoto 326e8012f7 guests/*: setup rsync_pre properly 2014-05-06 18:40:55 -07:00
Mitchell Hashimoto 4ef237a642 synced_folders/rsync: mkdir before rsync 2014-05-06 13:41:37 -07:00