From: Tom Hughes Date: Wed, 29 Apr 2020 22:02:04 +0000 (+0100) Subject: Don't try and set the hostname when running tests X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/645c0443f938774cf91ad21bde5f31d672f002e8?ds=sidebyside Don't try and set the hostname when running tests --- diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 03c7461a4..38c2156f2 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -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