]> git.openstreetmap.org Git - chef.git/commitdiff
Don't try and set the hostname when running tests
authorTom Hughes <tom@compton.nu>
Wed, 29 Apr 2020 22:02:04 +0000 (23:02 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 29 Apr 2020 22:02:04 +0000 (23:02 +0100)
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