]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/networking/recipes/default.rb
Don't try and set the hostname when running tests
[chef.git] / cookbooks / networking / recipes / default.rb
index 03c7461a4253419ffcdb4a9efcd0c1addbe45a5e..38c2156f2457d5544fc76588293dbc8e6f907542 100644 (file)
@@ -185,7 +185,7 @@ end
 execute "hostnamectl-set-static" do
   command "hostnamectl set-static #{node[:networking][:hostname]}"
   notifies :reload, "ohai[reload-hostname]"
-  not_if { node[:hostnamectl][:static_hostname] == node[:networking][:hostname] }
+  not_if { ENV.key?("TEST_KITCHEN") || node[:hostnamectl][:static_hostname] == node[:networking][:hostname] }
 end
 
 template "/etc/hosts" do