guests/redhat: DHCP_HOSTNAME set to hostname [GH-2441]

This commit is contained in:
Mitchell Hashimoto 2013-11-26 11:28:47 -08:00
parent 25d0dd149d
commit fc190fad9f
2 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@ BUG FIXES:
- core: provisoining will properly happen if `up` failed. [GH-2488]
- guests/freebsd: Mounting NFS folders works. [GH-2400]
- guests/freebsd: Uses `sh` by default for shell. [GH-2485]
- guests/redhat: `DHCP_HOSTNAME` is set to the hostname, not the FQDN. [GH-2441]
- guests/redhat: Down interface before messing up configuration file
for networking. [GH-1577]
- guests/ubuntu: "localhost" is preserved when changing hostnames.

View File

@ -9,7 +9,7 @@ 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("sed -i 's/\\(DHCP_HOSTNAME=\\).*/\\1\"#{name.split('.')[0]}\"/' /etc/sysconfig/network-scripts/ifcfg-*")
comm.sudo("service network restart")
end
end