Commit Graph

41 Commits

Author SHA1 Message Date
Colin Shea b31b240c8c
Support installing synced folder clients on arch 2016-07-18 22:33:04 -04:00
Seth Vargo ccc40eb19d
guests/arch: compute netmask
Arch expects /24 for netmask, but users usually specify as a netmask
block like 255.255.255.0. This automatically converts it.
2016-07-18 21:12:56 -04:00
Seth Vargo 9ea13105c0
guests/arch: Ensure exit on configure networks fail 2016-07-18 21:12:55 -04:00
Seth Vargo e69211ab22
guests/arch: Add NFS capabilities 2016-07-18 21:12:55 -04:00
Seth Vargo cf9a8e3c0a
guests/arch: Ensure exit on error setting hostname 2016-07-18 21:12:55 -04:00
Seth Vargo cf91bcf029
guests: Always search for FQDN without sudo 2016-07-18 21:12:54 -04:00
Seth Vargo 8f3b6511f2
guests/linux: Add shared cap for listing network interfaces 2016-07-18 21:12:54 -04:00
Seth Vargo 10b12ce393
guests/arch: Search for FQDN hostname 2016-07-18 21:12:51 -04:00
Seth Vargo b29864f450
Use symbols for defining guest capabilities 2016-06-17 19:55:04 -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 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
Lars Christensen a6565199ff Restart network after reconfiguration
Fixes #7119.
2016-03-08 16:24:24 +01:00
Mitchell Hashimoto 4988298b0b guests/arch: configure networks should enable device [GH-5737] 2015-11-19 11:39:04 -08:00
Douézan-Grard Guillaume 9d1834a3c9 Fix line breaks 2014-12-13 21:08:31 +01:00
SilverWyrda 384fd3ba98 Delegate cleaning to arch box packagers 2014-09-06 06:44:24 +02:00
SilverWyrda 10090bf4dc Add support for predictable network interfaces names 2014-09-06 04:56:01 +02:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mattox Beckman 17a3dff77f This is a followup to issue #2591.
Arch linux will rename its eth0 device unless an empty file is placed in `/etc/udev/rules.d/`.
In order for the new rules to take effect, we need call `udevadm control --reload`.
2014-03-25 20:44:42 -05:00
Matt Alexander edeb5f0e9f Add the symlink back that disabled renaming of network interface names 2013-12-07 14:59:40 -06:00
Matt Alexander df67d2b44f Run "ip link set [eth1] down" before running "netctl start [eth1]" in Arch guest network configuration 2013-12-07 14:22:19 -06:00
me 2a75c34d62 systemctl wasn't a good idea 2013-12-05 16:01:44 +01:00
me 158d82ea39 Avoid udev rule masking and configure ifaces with sed instead. 2013-12-05 15:16:59 +01:00
Boohbah 903578269b Use hostnamectl in plugins/guests/arch/cap/change_host_name.rb 2013-08-10 00:41:18 +00:00
Fabio Rehm 2d4a3994ea Merge pull request #1734 from frankshearar/arch-configure-network-needs-template
No TemplateRenderer for arch's configure_networks
2013-07-16 18:20:46 -07:00
Alper Kanat dbfce678bf fixed networking issues of Arch Linux with netctl changes 2013-05-24 00:19:31 +03:00
Frank Shearar 2eb97b518c You need to include the module to use the class without ::s. 2013-05-22 16:29:58 +01:00
Frank Shearar caf4ea722e Import the TemplateRenderer (like the other guests do). 2013-05-14 21:22:19 +01:00
Mitchell Hashimoto 7f33081387 Convert arch to capabilities 2013-04-04 11:39:58 -07:00
Mitchell Hashimoto 52f3847b0a Laying the foundation for the new guest plugin 2013-04-03 21:47:57 -07:00
Mitchell Hashimoto 1d2beff649 Guests to V2 2012-11-06 21:14:45 -08:00
Dan Midwood bdf72c5554 Use the communicate interface for ArchLinux guests 2012-09-02 18:00:11 +01:00
Mitchell Hashimoto da98ce59b3 Basic fixes to the configure_networks for Arch 2012-06-01 14:26:34 +02:00
Marco Monteiro f6c33fb4ef Fix reference to undefined variable 2012-06-01 14:24:15 +02:00
Marco Monteiro 5bbabaf5a5 Fix multiple ethernet interface support on Arch Linux 2012-06-01 14:23:15 +02:00
Mitchell Hashimoto 459d82689e Get rid of autoload use in Guests
I don't use `activated` here because I'd really like to optimize
performance as much as possible, and loading files from disk is
generally slow. So instead of using `activated` I load the file at the
last possible moment which is when the exact class is being requested.

I don't think many people will do this outside of the core, and I'm not
too concerned.
2012-05-23 15:57:43 -07:00
Mitchell Hashimoto 9956e6d012 Better directory structure for plugins 2012-04-20 16:53:01 -07:00