From 9d6a6cc9a1613d2aa8a5979ac8f3893cdad1ef29 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 17 Jul 2013 05:03:14 -0700 Subject: [PATCH] Allow hotplug on deb/ubuntu change host name [GH-1929] --- CHANGELOG.md | 2 ++ plugins/guests/debian/cap/change_host_name.rb | 2 +- plugins/guests/ubuntu/cap/change_host_name.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0746bc034..032e2ab8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ BUG FIXES: - Fix uninitialized constant error when configuring Arch Linux network. [GH-1734] + - Debian/Ubuntu change hostname works properly if eth0 is configured + with hot-plugging. [GH-1929] ## 1.2.4 (July 16, 2013) diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index fe01aed4f..114916015 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -9,7 +9,7 @@ module VagrantPlugins comm.sudo("sed -i 's/.*$/#{name.split('.')[0]}/' /etc/hostname") comm.sudo("hostname -F /etc/hostname") comm.sudo("hostname --fqdn > /etc/mailname") - comm.sudo("ifdown -a; ifup -a") + comm.sudo("ifdown -a; ifup -a --allow=hotplug") end end end diff --git a/plugins/guests/ubuntu/cap/change_host_name.rb b/plugins/guests/ubuntu/cap/change_host_name.rb index 3e84bc787..19e9cd887 100644 --- a/plugins/guests/ubuntu/cap/change_host_name.rb +++ b/plugins/guests/ubuntu/cap/change_host_name.rb @@ -14,7 +14,7 @@ module VagrantPlugins comm.sudo("service hostname start") end comm.sudo("hostname --fqdn > /etc/mailname") - comm.sudo("ifdown -a; ifup -a") + comm.sudo("ifdown -a; ifup -a --allow=hotplug") end end end