Merge pull request #2267 from fcharlier/fcharlier/dhcp_hostname_redhat

guests/redhat: Allow to change the DHCP_HOSTNAME on RedHat
This commit is contained in:
Mitchell Hashimoto 2013-09-25 01:47:55 -07:00
commit 0d739035b5
1 changed files with 2 additions and 0 deletions

View File

@ -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