Commit Graph

19 Commits

Author SHA1 Message Date
phinze 688bca14f5 refactoring ubuntu/debian change_host_name
there's been a lot of churn around this code, so i figure it was worth
trying to clean it up.

 - the methods were doing a lot, so make them into template methods with
   one helper per step
 - spread out /etc/hosts regexp into a couple of helper variables for
   clarity
 - remove handling for broken hostname implementations (like basing all
   of the checks on name.split('.')[0]), since it seems reasonable to
   remove code dedicated only to handling broken boxes
 - DRY up the shared code between debian/ubuntu implementations, which
   clarifies the differences as well
 - add unit tests around the behavior; this will help us in the future
   to separate flaws in our understanding from flaws in implementation
 - includes a new DummyCommunicator in tests which should be useful in
   supporting additional unit testing of this kind
 - manually tested this on squeeze, wheezy, precise, quantal, raring,
   and saucy successfully.

handles the issue in #2333
2013-11-24 11:46:12 -06:00
Teemu Matilainen 2073a1a939 Fix hostname setting also in Debian, part N
Port #2384 / #2383 for Debian guests.
2013-10-31 21:39:45 -03:00
Teemu Matilainen 330f72eae2 Fix hostname setting also in Debian
Same fix as #2334.
2013-10-15 15:57:40 -03:00
Alan Braithwaite 7d53047a92 Fixed fqdn handling on debian/ubuntu
The issue was that the old method simply didn't work.  When the hosts
file should look like:
    127.0.1.1   host.fqdn.com host
It looked like:
    127.0.1.1   host.fqdn.com host old.fqdn.com old
Or this if the user didn't set a fqdn
    127.0.1.1   host host old.fqdn.com old

This patch fixes that.
2013-09-22 00:33:24 -07:00
Philipp Gysin b6f2443bd5 Forcing eth0 to come up 2013-08-05 18:02:12 +02:00
Mitchell Hashimoto bc7b481dbe Get the deb/ubuntu change host name correct 2013-07-17 13:39:32 -05:00
Mitchell Hashimoto 9d6a6cc9a1 Allow hotplug on deb/ubuntu change host name [GH-1929] 2013-07-17 05:03:48 -07:00
Franz Pletz 65f275a5a8 DHCP renewal on Debian/Ubuntu after setting hostname
On Debian and Ubuntu guests, when the new hostname of the guest box is
set, the DHCP client (isc-dhcp-client) won't renew its DHCP lease with
the new hostname. Executing "ifdown -a; ifup -a" to reinitialize all auto
interfaces fixes this issue.

Furthermore, as vagrant will now actually wait until a DHCP lease is
acquired, it is guaranteed that the the correct domainname is set from
DHCP before calling other provisioners like puppet, that rely on it.
This fixes puppet/facter sometimes failing to find the fqdn fact on an
LXC guest when the DHCP server is responding too slow.
2013-07-15 12:54:52 +02:00
Fabio Rehm 4625d77072 More reliable Ubuntu and Debian guest detection
When dealing with lxc containers, '/proc/version' will have information
about the host machine kernel that can possibly have information about
an Ubuntu / Debian host, messing up with guest container detection.
2013-05-01 21:00:39 -03:00
Mitchell Hashimoto fd157476b4 extend should be include for TemplateRenderer in caps 2013-04-08 10:47:19 -07:00
Mitchell Hashimoto 7b9e5fd4a7 Include should be extend for class methods 2013-04-04 12:25:40 -07:00
Mitchell Hashimoto 61d2f9f96f SetHostname uses new cap system 2013-04-03 23:18:12 -07:00
Mitchell Hashimoto 2a542dab02 Switch configure_networks to capabilities system 2013-04-03 23:08:33 -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
Mitchell Hashimoto f193d69fbc Fix up the debian guest to work with the new machine API 2012-08-20 14:58:58 -07:00
Bob Maerten 3dda019cac change_host_name should change mailname too
On Debian systems config.hostname directive should change /etc/mailname
in order to prevent problems with default mailer trying to contact
default vm's name.
2012-07-13 15:07:56 +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