From c1228ae206648b3643366defbd9dab01cb80d5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Charlier?= Date: Tue, 24 Sep 2013 23:48:10 +0200 Subject: [PATCH] Allow to change the DHCP_HOSTNAME on RedHat --- plugins/guests/redhat/cap/change_host_name.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/guests/redhat/cap/change_host_name.rb b/plugins/guests/redhat/cap/change_host_name.rb index 1c0cb75db..967463c3a 100644 --- a/plugins/guests/redhat/cap/change_host_name.rb +++ b/plugins/guests/redhat/cap/change_host_name.rb @@ -9,6 +9,8 @@ module VagrantPlugins comm.sudo("sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network") comm.sudo("hostname #{name}") comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") + comm.sudo("sed -i 's/\\(DHCP_HOSTNAME=\\).*/\\1\"#{name}\"/' /etc/sysconfig/network-scripts/ifcfg-*") + comm.sudo("service network restart") end end end