Hostname and FQDN should be done in one line
This commit is contained in:
parent
0db87ff406
commit
9ca6fbe8f4
plugins/guests/ubuntu/cap
|
@ -21,10 +21,8 @@ module VagrantPlugins
|
||||||
|
|
||||||
# hosts should resemble:
|
# hosts should resemble:
|
||||||
# 127.0.1.1 host.fqdn.com host
|
# 127.0.1.1 host.fqdn.com host
|
||||||
# First to set fqdn
|
# Set FQDN, hostname in one line
|
||||||
comm.sudo("sed -i 's@#{old}@#{name}@' /etc/hosts")
|
comm.sudo("sed -i 's@#{old}@#{name} #{name.split('.')[0]}@' /etc/hosts")
|
||||||
# Second to set hostname
|
|
||||||
comm.sudo("sed -i 's@#{old.split('.')[0]}@#{name.split('.')[0]}@' /etc/hosts")
|
|
||||||
|
|
||||||
if comm.test("[ `lsb_release -c -s` = hardy ]")
|
if comm.test("[ `lsb_release -c -s` = hardy ]")
|
||||||
# hostname.sh returns 1, so I grep for the right name in /etc/hostname just to have a 0 exitcode
|
# hostname.sh returns 1, so I grep for the right name in /etc/hostname just to have a 0 exitcode
|
||||||
|
|
Loading…
Reference in New Issue