diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-05-15 09:42:23 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-05-15 09:42:23 -0700 |
commit | 2fef692453bbbb75403a9aa31cc22224fb9db407 (patch) | |
tree | 42c1bcf3dfd60276027a49832badb6d28f0b9c1f | |
parent | c0609e449135fae43d436136a4f0fd3889a9b8f1 (diff) | |
download | chef-lcg/hostnamectl-anchor.tar.gz |
anchor the hostnamectl regexlcg/hostnamectl-anchor
closes #7260
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/resource/hostname.rb | 2 |
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 |