guests/atomic: Ensure error exit when setting hostname
This commit is contained in:
parent
ccc40eb19d
commit
0af02fc78c
|
@ -8,6 +8,9 @@ module VagrantPlugins
|
||||||
if !comm.test("hostname -f | grep '^#{name}$'", sudo: false)
|
if !comm.test("hostname -f | grep '^#{name}$'", sudo: false)
|
||||||
basename = name.split(".", 2)[0]
|
basename = name.split(".", 2)[0]
|
||||||
comm.sudo <<-EOH.gsub(/^ {14}/, "")
|
comm.sudo <<-EOH.gsub(/^ {14}/, "")
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Set hostname
|
||||||
hostnamectl set-hostname '#{basename}'
|
hostnamectl set-hostname '#{basename}'
|
||||||
|
|
||||||
# Remove comments and blank lines from /etc/hosts
|
# Remove comments and blank lines from /etc/hosts
|
||||||
|
|
Loading…
Reference in New Issue