Commit graph

185 commits

Author SHA1 Message Date
jklippel
b10bc2e8c2 Vagrant-Issue: 7368: redirect any output to stderr by /sbin/init to /dev/null when checking for upstart capability 2016-11-29 08:10:25 +01:00
Chris Roberts
5482692127 guests/linux: Only match interfaces without special characters 2016-11-10 07:19:26 -08:00
Chris Roberts
fb4e4320b2 Remove set -e usage for better shell compatibility 2016-10-24 10:30:08 -07:00
Chris Roberts
d0549d6e11 guests/linux: Provide common linux detection style
Defines a common and generic linux detection strategy which can be
subclassed and easily reused by providing a custom detection constant.
2016-10-11 07:50:34 -07:00
Chris Roberts
07ce1c6930 Merge pull request #7866 from chrisroberts/guest-linux/network-interfaces-sorting
guests/linux: Update network interface sorting implementation
2016-10-10 10:59:52 -07:00
Chris Roberts
a8970281ce guests/linux: Properly sort interface name types
Add failing networking interface list sorting test with example
provided by #7883. Update sorting logic to properly handle different
types and differing array lengths.

Fixes #7883
2016-10-10 10:22:19 -07:00
Chris Roberts
b738aaac0f Merge pull request #7813 from rudineirk/fix-non-upstart-linux
Fix non upstart linux nfs mounts
2016-10-06 12:59:23 -07:00
Chris Roberts
e2b18fc65d guests/linux: Update network interface sorting implementation
Always pull ordered ethernet devices to the head of the list. Ensure
aliases are not included.
2016-10-04 17:25:00 -07:00
Chris Roberts
0300df09fb guests/linux: Update constant name, freeze constant values 2016-09-30 12:11:54 -07:00
Chris Roberts
9f468d2626 guests/linux: Place ethernet devices at start of device list 2016-09-29 15:33:29 -07:00
Rudinei Goi Roecker
8b8c961935 Fix non upstart linux nfs mounts 2016-09-20 17:57:54 -03:00
Chris Roberts
a7537a6be0 Merge pull request #7726 from chrisroberts/fix/rsync-exclude
Ignore files excluded from sync on chown
2016-08-19 09:58:31 -07:00
Chris Roberts
dd6ad2fbf3 guests/linux: only use effective group ID when appropriate 2016-08-17 06:53:26 -07:00
Chris Roberts
185a7dfc2e guests/rsync do not chown files excluded from sync 2016-08-16 15:13:19 -07:00
Chris Roberts
dd91269491 guests: Prevent ssh disconnect from causing error on halt 2016-08-12 13:25:39 -07:00
Chris Roberts
ce3329e184 guests/linux: Always order discovered network interfaces 2016-08-12 10:31:41 -07:00
hendrenj
855643e9a5 s/bsd/linux/ 2016-07-19 11:45:03 -06:00
hendrenj
a6760dd8e7 fixes #7610 2016-07-19 11:22:35 -06:00
Seth Vargo
7f1947fec2
folders/rsync: Shellescape guest paths
This allows users to have spaces or other special characters in
destination paths on the guest.
2016-07-18 21:13:00 -04:00
Seth Vargo
1c0d0b8b9d
guests/linux: Style update for choose_addressable_ip 2016-07-18 21:12:59 -04:00
Seth Vargo
e2becda89d
guests/gentoo: Use shared cap for listing network interfaces 2016-07-18 21:12:59 -04:00
Seth Vargo
7e88266999
guests/linux: Properly escape and retry vbox shared folder mounting 2016-07-18 21:12:57 -04:00
Seth Vargo
4aaa600bd6
guests/linux: Centralize public_key logic 2016-07-18 21:12:57 -04:00
Seth Vargo
627091de35
guests/linux: reorg 2016-07-18 21:12:55 -04:00
Seth Vargo
8f3b6511f2
guests/linux: Add shared cap for listing network interfaces 2016-07-18 21:12:54 -04:00
Seth Vargo
851eff1288
guests/linux: Ensure NFS retries when mounting
Fixes GH-7443
2016-06-19 14:34:33 -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
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
Jonathan
d1be7ae84a Better method for string concatenation
Never developed in Ruby before. I have only just discovered that apparently `<<` is a better method of string concatenation.
2016-06-16 11:59:11 +01:00
Jonathan
2720ed3d2c Apply new line before shell to system
Having looked at the code again this seems like a more straightforward way of fixing the bug.
2016-06-16 11:47:47 +01:00
Jonathan
f7f46ba47d Append newline to each key added
The change to this file 10 days ago removed a newline character at the end of each key added to it. This mean that when another key was added, it continued on the same line as the one before and thus wasn't being detected when an ssh connection came in with a key file.

With regards to https://github.com/mitchellh/vagrant/issues/7455 this is an (ugly) fix.

I'm sure someone knows a better command to concat a file and a string and append it to the `authorized_keys` file. But this does fix the problem.
2016-06-15 23:56:22 +01:00
Seth Vargo
61d2a50a54
guests/linux: Fix compatibility with dash shell 2016-06-06 12:59:51 -04:00
Seth Vargo
337e3d79d8
guests/linux: Use require_relative in plugin 2016-06-06 11:58:33 -04:00
Seth Vargo
b643031b05
guests/linux: Do not require vagrant in guest 2016-06-06 11:58:33 -04:00
Seth Vargo
837713c2d1
guests/linux: Mount NFS in one command 2016-06-06 11:58:32 -04:00
Seth Vargo
e2b7e28082
guests/linux: Update insert_public_key cap to be one command 2016-06-06 11:58:32 -04:00
Seth Vargo
d4159e4208
guests/linux: Add tests for choosing addressable IP 2016-06-06 11:58:31 -04:00
Seth Vargo
fbd765acc1 Do not interpolate in SMB linux heredoc
Fixes GH-6906
2016-02-29 07:19:45 -05:00
Mitchell Hashimoto
72f60aff65 whitespace 2015-12-24 12:44:58 -08:00
Mitchell Hashimoto
601f7d41e5 synced_folders/smb: use cred files [GH-4230] 2015-11-23 11:11:50 -08:00
Mikhail Zholobov
4e4029a076 Fix permissions on "~/.ssh/authorized_keys" 2015-11-22 19:24:33 +02:00
Mitchell Hashimoto
f5cadc93fa guests/linux: POSIX sed [GH-6104] 2015-11-19 18:35:18 -08:00
Seth Vargo
82f620ed13 Fix upstart detection and event emit 2015-11-18 16:18:32 -08:00
Seth Vargo
5f383b546c Use sudo for read_ip_address capability
Fixes #4868
2015-07-10 13:25:11 -06:00
Mitchell Hashimoto
92e6062f8d Merge pull request #5622 from aneeshusa/fix-mounting-with-inactive-upstart
Check Upstart is running before emitting upstart events.
2015-07-06 16:20:21 -06:00
Mitchell Hashimoto
262b50bc02 guests/linux: fix exception when printf is empty [GH-5846] 2015-07-05 17:14:48 -07:00
Francesco
ca8923835a Use the extended password parameter, more compatible 2015-06-08 04:13:23 +01:00
Aneesh Agrawal
49ff17b9b9 Check Upstart is running before emitting upstart events.
Fixes issue #5377.
Check that Upstart is not just installed but currently actively running
before attempting to emit an event after mounting shared folders.
Only requires the binary be named upstart, not that it lives in /sbin.
2015-04-22 09:20:27 -04:00
Jeff Johnson
9d50f72df3 For SMB on Linux guests, specify the user's domain as a separate parameter to the mount command. This is more reliable than passing user@domain as the username. This is not needed for SMB on Windows guests as they expect the user@domain form.
This does not change how it is configured in the Vagrantfile.

Fixes #3620
2015-03-31 08:16:06 -07:00
Seth Vargo
d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Mitchell Hashimoto
94b2a8a56b communicators/ssh: insert random key, remove insecure key 2014-10-24 09:58:18 -07:00
dch
97589636b1 Provide output on raising LinuxMountFailed 2014-10-14 18:25:13 +01:00
Mitchell Hashimoto
b2b79a4ea8 guests/linux: backoff a bit on the mount timeout [GH-4403] 2014-08-29 09:47:34 -07:00
Mitchell Hashimoto
b42e9aef23 guests/linux: more verbose output when shared folder mount fails
[GH-4403]
2014-08-29 08:27:48 -07: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
Mitchell Hashimoto
c7abea2032 guests/linux: exclude symlinks from chown search [GH-3744] 2014-05-09 16:08:11 -07: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
Jonas Stendahl
8b5869fdc5 Don't wrap the escaped password in single quotes. 2014-05-06 15:47:44 +02:00
Mitchell Hashimoto
04369b3afe guests/linux: LANG=en for ifconfig [GH-3029] 2014-05-04 17:47:16 -07:00
Nikhil Benesch
2df36892dd synced_folders/rsync: only chown when necessary [GH-3525]
Run remote rsync as root to guarantee that rsync can write to guestpath.
This obviates the need to chown the guestpath to the SSH user prior to
sync.

This brings a substantial speedup (2x on a moderately-sized shared
folder) and properly triggers filesystem notifications on only the files
changed by a given sync.
2014-04-25 15:00:12 -04:00
Mitchell Hashimoto
22d9b0eeb2 guests/linux: unmount uses rmdir instead of rm -rf to avoid catastrophe 2014-04-21 13:56:30 -07:00
Mitchell Hashimoto
19c9973a0d guests/linux: set a timeout on nc 2014-04-21 13:55:40 -07:00
Mitchell Hashimoto
e578e91e3a providers/docker: implement port checker for remote machine 2014-04-21 13:55:39 -07:00
Mitchell Hashimoto
3edfe6deaf providers/docker: remove synced folders after docker rm 2014-04-21 13:55:28 -07:00
Nikhil Benesch
ee5d8e2358 guests/linux: rsync chown if either user or group incorrect [GH-3485] 2014-04-15 16:55:49 -04:00
Mitchell Hashimoto
9529dd8cde guests/linux: rsync chown group if owner now set [GH-3223] 2014-04-09 11:03:24 -07:00
Mitchell Hashimoto
b20ff91784 guests/linux: SMB mounts with symbol passwords work [GH-3202] 2014-04-09 10:46:56 -07:00
Mitchell Hashimoto
a6725710d3 guests/linux: don't show SMB password in plaintext on error [GH-3203] 2014-04-09 10:42:39 -07:00
Andy Clarke
26e0c85488 Fix SMB shared folder mount error with password containing symbols. 2014-03-17 17:38:34 -04:00
Mitchell Hashimoto
ca00ad8257 guests/linux: one more time 2014-03-13 09:48:53 -07:00
Mitchell Hashimoto
3c02caf811 guests/linux: check for proper owner [GH-3186] 2014-03-13 09:48:22 -07:00
Mitchell Hashimoto
00d73eabda guests/linux: rsync only chown if invalid user/group [GH-3186] 2014-03-13 09:47:34 -07:00
Mitchell Hashimoto
a6eafd6a12 synced_folders/rsync: execute rsync_post cap if it exists [GH-3163] 2014-03-12 18:43:59 -07:00
Mitchell Hashimoto
0fe4a4af26 synced_folders/smb: basically working 2014-02-27 08:13:05 -08:00
Mitchell Hashimoto
e909b91bfd guests/linux: public key insertion is more robust
contents can have newlines (or not)
2014-02-12 22:11:33 -08:00
Mitchell Hashimoto
8c85e57db1 guests/linux: proper logic on ro 2014-02-07 16:04:36 -08:00
Michael Hahn
d68544a906 Ensure options[:mount_options] is defined before checking if it includes key 2014-02-06 14:06:47 -08:00
Michael Hahn
3631b250b7 Fix #2945: Reference correct options variable 2014-02-06 13:59:56 -08:00
Mitchell Hashimoto
226dbccef8 guests/linux: don't chown VB shared folders if readonly [GH-2442] 2014-02-04 16:01:14 +01:00
Mitchell Hashimoto
f63ef395f1 Merge branch 'rsync_install' of https://github.com/tmatilai/vagrant into tmatilai-rsync_install
Conflicts:
	plugins/guests/freebsd/plugin.rb
	plugins/guests/netbsd/plugin.rb
	plugins/guests/openbsd/plugin.rb
2014-02-03 12:12:49 +01:00
Teemu Matilainen
e634cdc824 guests: rename LinuxShellExpandFailed error to ShellExpandFailed
Make the error generic for all guests (`DarwinShellExpandFailed` didn't
even exist) and not tied to synced folder.
2014-02-02 17:26:54 -03:00
Teemu Matilainen
ee2ae94c25 synced_folders/rsync: Install rsync on guest if needed
Add new `rsync_installed` and `rsync_install` guest capabilities
to detect and install `rsync`.

Also copy `rsync_pre` capability to all Unix guests.
2014-01-31 02:12:57 -03:00
Mitchell Hashimoto
2e3fcf576c synced_folders/rsync: allow guests to execute things before 2014-01-10 17:51:44 -08:00
Mitchell Hashimoto
91380c0650 synced_folders/nfs: automatically install NFS client if possible
If guests have the following capabilities, automatic NFS client
installation will be done:

  * nfs_client_installed - Checks if the NFS client is installed
  * nfs_client_install - Install the NFS client

Support is already in for Debian, Ubuntu, RedHat, CentOS, and Fedora
2014-01-09 16:58:20 -08:00
Mitchell Hashimoto
732a03c1c4 guests/linux: properly quote and insert public key 2014-01-08 15:12:26 -08:00
Mitchell Hashimoto
b3a9e6a088 insert_public_key cap, and use that if it exists 2014-01-03 11:13:21 -08:00
Teemu Matilainen
572cdeeda9 guests/linux: Emit upstart event on VirtualBox using the expanded path 2013-12-22 08:55:59 -03:00
Teemu Matilainen
2fab268ede guests/linux: Emit upstart event vagrant-mounted also on NFS mounts
Complements #2502, and fixes error on VMs without upstart (like #2596).
2013-12-22 08:46:24 -03:00
Mitchell Hashimoto
489506ff83 guests/linux: up the amount of retries for NFS mounts 2013-12-18 08:38:31 -08:00
Teemu Matilainen
c566465bdc Fix testing if initctl exists
If /sbin/initctl was not found, the command (`false && ...`) returned
non-zero exit code leading to Vagrant throwing an exception.
2013-12-06 18:17:41 -03:00
Mitchell Hashimoto
d9dc2d6cfd guests/linux: --no-wait on emit [GH-2564] 2013-12-03 12:14:10 -08:00
Mitchell Hashimoto
195f0d9639 guests/linux: emit upstart event for vagrant mounted if avail [GH-2502] 2013-11-25 11:31:15 -08:00
Mitchell Hashimoto
23bdbd6fd8 synced_folders/nfs: specify nfs_udp false to disable udp [GH-2304] 2013-11-23 13:43:48 -08:00
Mitchell Hashimoto
88425f0146 Merge pull request #2390 from borgstrom/master
core: allow owner & group to be supplied as an Integer and skip lookup
2013-11-23 11:46:50 -08:00
Mitchell Hashimoto
dcf57bd2cc guests/linux: increase sleep time btween NFS mount retries 2013-11-23 11:35:27 -08:00
Evan Borgstrom
ebb85b57fd Allow owner & group to be supplied as an Integer and skip lookup 2013-10-17 22:40:21 -04:00
Pete Michaud
e65ac705b4 fixed missing backtick 2013-09-21 21:41:06 -05:00