Commit Graph

9079 Commits

Author SHA1 Message Date
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 8c095ef172
guests/fedora: Configure hostname in one command 2016-06-06 11:58:29 -04:00
Seth Vargo d9b8352a58
guests/debian: Use predictable naming for network configuration 2016-06-06 11:58:28 -04:00
Seth Vargo dbb2d99278
guests/debian: Update guest capabilities
This updates the guest capabilities to run in as few communicator
commands as possible. Additionally, it fixes a number of issues around
hostname and idempotency.

This patch was tested against:

- puphpet/debian75-x64
- debian/jessie64
- debian/wheezy64

with custom networking, custom hostname, and rsync shared folders.
2016-06-06 11:58:28 -04:00
Seth Vargo a3d45bb7e0
guests/darwin: Use require_relative in plugin defn 2016-06-06 11:58:28 -04:00
Seth Vargo 428d6b56e8
guests/darwin: Require vagrant 2016-06-06 11:58:28 -04:00
Seth Vargo 499e4afba8
guests/darwin: Upload public key instead of trying to shellescape 2016-06-06 11:58:27 -04:00
Seth Vargo dc883aa46f
guests/darwin: Add tests for get_addressable_ip_addr 2016-06-06 11:58:27 -04:00
Seth Vargo 5683a3b8ca
guests/darwin: Configure hostname in a single command 2016-06-06 11:58:27 -04:00
Seth Vargo 249cda879d
guests/coreos: Use require_relative in plugin defn 2016-06-06 11:58:27 -04:00
Seth Vargo 7906718347
guests/coreos: Require "vagrant" 2016-06-06 11:58:26 -04:00
Seth Vargo 3ca048a8fa
guests/coreos: Configure networks in one command
This commit configures all the network devices in a single command.
2016-06-06 11:58:26 -04:00
Seth Vargo fee0545b23
guests/coreos: Do not use sudo for looking up hostname 2016-06-06 11:58:26 -04:00
Seth Vargo 0b2804fbb0
guests/atomic: Use require_relative in plugin defn 2016-06-06 11:58:25 -04:00
Seth Vargo 31e02cddf5
guests/atomic: Do not use sudo when checking hostname
The `hostname` command does not require root to execute
2016-06-06 11:58:25 -04:00
Seth Vargo 50690dab12
guests/atomic: Add tests for docker capability
This commit adds missing test coverage for the Docker capability on
atomic guests.
2016-06-06 11:58:25 -04:00
Seth Vargo 4f0c3474f2
guests/atomic: Update hostname capability
This commit does a few things:

1. Make the hostname update idempotent with `grep -w`
2. Add the given hostname to `/etc/hosts` as recommended by the docs
3. Add missing tests
2016-06-06 11:58:25 -04:00
Seth Vargo 3a9ac19f7e
guests/arch: Use require_relative in plugin defn 2016-06-06 11:58:24 -04:00
Seth Vargo cb0e77692c
guests/arch: Do not use sudo when checking hostname
The `hostname` command does not require root to execute
2016-06-06 11:58:24 -04:00
Seth Vargo d77ad5c941
guests/arch: Configure networks in one command
This commit updates the procedure for configuring arch networks to occur
in a single command. Previously, each network was configured
independently. If, for some reason, one of the networks destroyed the
SSH connection, the box would be irrecoverable. This commit does not
alleviate that behavior, but attempts to mitigate it by running all
network-related configuration commands in a single communicator (SSH)
session.

The new procedure looks like this:

1. Upload a temp file to /tmp/vagrant-network-id... for each interface
  on the guest.
2. Compile a commands array (of bash) to execute after all network
  configurations have been uploaded.
3. Concatenate all the commands together in a single communicator
  session.

This was tested against `terrywant/archlinux` using the following Vagrantfile:

```ruby
Vagrant.configure(2) do |config|
  config.vm.box = "terrywang/archlinux"
  config.vm.hostname = "banana-ramama.example.com"

  config.vm.network "private_network", type: "dhcp"

  config.vm.network "private_network", ip: "33.33.33.10"

  config.vm.provision "file", source: "Vagrantfile", destination: "/tmp/vf"
  config.vm.provision "shell", inline: "echo hi"
end
```
2016-06-06 11:58:24 -04:00
Seth Vargo 41d61120a5
guests/arch: Change hostname in one command
This commit updates the procedure for changing the hostname on arch
guests to occur in a single command. Previously, setting the hostname
and adding the value of the hostname to the /etc/hosts file was done in
two different uploads. This reduces the cycle to a single upload, making
provisioning a bit faster.

Additionally, this changes the behavior of the /etc/hosts file to:

1. Not remove localhost as an alias of 127.0.0.1
2. Prepend our custom hostname before localhost

The resulting /etc/hosts file will look something like:

127.0.0.1 my-host.example.com my-host
127.0.0.1 localhost.mydomain localhost

Tested against `terrywang/archlinux` using the following Vagrantfile:

```ruby
Vagrant.configure(2) do |config|
  config.vm.box = "terrywang/archlinux"
  config.vm.hostname = "banana-ramama.example.com"

  config.vm.network "private_network", type: "dhcp"

  config.vm.network "private_network", ip: "33.33.33.10"

  config.vm.provision "file", source: "Vagrantfile", destination: "/tmp/vf"
  config.vm.provision "shell", inline: "echo hi"
end
```
2016-06-06 11:58:24 -04:00
Seth Vargo cbc90d6391 Update ISSUE_TEMPLATE.md 2016-06-06 09:58:25 -04:00
Seth Vargo 8d2ca8a1eb
Update CHANGELOG 2016-06-04 15:22:49 -04:00
Seth Vargo b3cabe0180 Merge pull request #7379 from mitchellh/sethvargo/update_uniq
core/boxes: Do not update the same box twice
2016-06-04 21:22:06 +02:00
David O'Rourke 60fd777806 prepare_nfs_settings: Use scoped hash override when reading static IPs. 2016-06-03 15:19:23 +01:00
David O'Rourke 514193090a prepare_nfs_settings: Add scoped hash override test. 2016-06-03 15:19:03 +01:00
Seth Vargo 9bec6c0a06 Merge pull request #7382 from falconed/master
provisioners/ansible: Fix documentation typo
2016-06-02 04:16:43 -05:00
Dan Falcone 219007c6e6 provisioners/ansible: Fix documentation typo 2016-06-01 20:01:10 -04:00
Seth Vargo 3fa30a71b0
provisioners/salt: Doc - fix typo 2016-06-01 08:31:31 -04:00
Gilles Cornu a7ee56459b provisioners/ansible(both): fix ansible config files presence checks
With this change, the presence of Ansible configuration files (like
playbook file, inventory path, galaxy role file, etc.) is no longer
performed by the `config` classes, but by the `provisioner` classes
(at the beginning of the provision command).

This change fixes several issues:

- Resolve #6984 as `provision` method are only executed when remote
  (ssh) communication with the guest machine is possible.
- Resolve #6763 in a better way than 4e451c6 initially did.
- Improve the general provisioner speed since the `config` checks are
  actually triggered by many vagrant actions (e.g. `destroy`,...), and
  can also be triggered multiple times during a vagrant run (e.g. on
  callback request made by the machine provider).

Unlike the former `config`-based checks, the provision action won't
collect all the invalid options, but only report the first invalid
option found and abort the execution.

Some unit tests were not implemented yet to save my scarce "open source
contribution time" for other important issues, but they should be done
at last via GH-6633.
2016-06-01 06:40:23 +02:00
Seth Vargo dab4537682
core/boxes: Do not update the same box twice
Vagrant's environment (which includes the known list of boxes and
versions) is established at the start of the Vagrant run. This means
that box downloads which occur during the run are not contained in the
set until the next run. This causes duplicate box downloads to raise an
error in multi-machine Vagrantfiles.

This commit fixes that issue by pre-processing the machines by provider
and version, creating a unique set of boxes to update.

Fixes GH-6042
2016-05-31 23:08:51 -04:00
Seth Vargo 228abf27a6
provisioner/salt: fix orchestrations documentation
Fixes GH-7209
2016-05-31 22:06:57 -04:00
Seth Vargo 37cdabc2e7
Update CHANGELOG 2016-05-31 20:10:16 -04:00
Seth Vargo 8c17807080 Merge pull request #7377 from mitchellh/sethvargo/docker-exec
Add docker-exec
2016-05-31 20:08:57 -04:00
Seth Vargo e270e7df27
provider/docker: Add -u flag to exec 2016-05-31 20:05:27 -04:00
Seth Vargo cfac24779c
provider/docker: Separate -i and -t flags for exec 2016-05-31 20:05:27 -04:00
Seth Vargo bf96b3348b
provider/docker: Add docker-exec command
This adds a new core command, `docker-exec`, which allows the user to
exec into an already-running container.

- Fixes #6566
- Fixes #5193
- Fixes #4904
- Fixes #4057
- Fixes #4179
- Fixes #4903
2016-05-31 20:05:26 -04:00
Seth Vargo 084a8e8fe7 Merge pull request #7376 from karlkfi/karlkfi/gem-all
Don't restore Gem::Specification.all if it's not being replaced
2016-05-31 17:59:25 -04:00
Seth Vargo 9a28a03b2c
Update CHANGELOG 2016-05-31 17:56:40 -04:00
Seth Vargo e1ea81847d Merge pull request #7276 from ryanheffernan/fix/master/issue7275
Adding Fedora IPv6 Static Address Support
2016-05-31 17:55:41 -04:00
Karl Isenberg f084fc7d78 Revert 3f9fb2ef03 from GH-2769
- For compatibility with ba77d4b533

Fixes GH-7073
2016-05-31 14:52:43 -07:00
Mitchell Hashimoto e2fd0dd792
Up bundler dep 2016-05-31 12:53:39 -07:00
Seth Vargo cf02135290 Merge pull request #7359 from mitchellh/sethvargo/cache_platform
Cache the results of common operations
2016-05-31 11:03:46 -04:00
nico.vanelslande 163e1997a6 Make virtualbox vm_exists? more resilient to VirtualBox transient failures.
We know that the vm does not exist if we get VBOX_E_OBJECT_NOT_FOUND.
For any other error, this may well be VirtualBox getting confused and it is probably
worth retrying...
2016-05-31 13:23:56 +01:00
Seth Vargo 49ce775b53
Prefix tempfiles with vagrant- 2016-05-31 00:18:16 -04:00
Seth Vargo 97f5ace2f2 Merge pull request #7370 from mitchellh/sethvargo/rm_custom_tempfile
Remove custom tempfile class
2016-05-30 23:29:03 -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 f2c769dd4f
Merge branch 'sethvargo/erb_no_sudo' 2016-05-30 21:02:27 -04:00
Seth Vargo 9c5404c9b8
Update CHANGELOG 2016-05-30 21:02:09 -04:00