summaryrefslogtreecommitdiff
path: root/lib/chef/resource/hostname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/hostname.rb')
-rw-r--r--lib/chef/resource/hostname.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 243c86287b..928c56b700 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -116,7 +116,7 @@ class Chef
# this must come before other methods like /etc/hostname and /etc/sysconfig/network
declare_resource(:execute, "hostnamectl set-hostname #{new_resource.hostname}") do
notifies :reload, "ohai[reload hostname]"
- not_if { shell_out!("hostnamectl status", { :returns => [0, 1] }).stdout =~ /Static hostname:\s+#{new_resource.hostname}/ }
+ not_if { shell_out!("hostnamectl status", { :returns => [0, 1] }).stdout =~ /Static hostname:\s+#{new_resource.hostname}$/ }
end
when ::File.exist?("/etc/hostname")
# debian family uses /etc/hostname