]> git.openstreetmap.org Git - chef.git/commitdiff
Make configuration of hostname work properly
authorTom Hughes <tom@compton.nu>
Thu, 16 Apr 2020 08:16:53 +0000 (09:16 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 16 Apr 2020 08:16:53 +0000 (09:16 +0100)
cookbooks/networking/attributes/default.rb
cookbooks/networking/recipes/default.rb
cookbooks/networking/templates/default/hostname.erb [deleted file]
roles/fume.rb

index a98942e4bd8d42fc6589d79c52a7196fdfe035b2..8d5cb035e220ce622f6b0823c4112825dd9dbc49 100644 (file)
@@ -10,3 +10,4 @@ default[:networking][:interfaces] = {}
 default[:networking][:nameservers] = []
 default[:networking][:search] = []
 default[:networking][:dnssec] = "allow-downgrade"
+default[:networking][:hostname] = node.name
index 89e8198e223ba0545b479afaa87d50ec440666d6..321109a1de0d04127c0ee4a0ecb90784f5552768 100644 (file)
@@ -177,18 +177,7 @@ package "cloud-init" do
   action :purge
 end
 
-execute "hostname" do
-  action :nothing
-  command "/bin/hostname -F /etc/hostname"
-end
-
-template "/etc/hostname" do
-  source "hostname.erb"
-  owner "root"
-  group "root"
-  mode 0o644
-  notifies :run, "execute[hostname]"
-end
+hostname node[:networking][:hostname]
 
 template "/etc/hosts" do
   source "hosts.erb"
diff --git a/cookbooks/networking/templates/default/hostname.erb b/cookbooks/networking/templates/default/hostname.erb
deleted file mode 100644 (file)
index 9842667..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<%= node[:fqdn] %>
index 176a22d617b8299289a5cf33b1143163802e11b5..44d665e30429ddeea51abda1bb91f5aebf13c921 100644 (file)
@@ -6,6 +6,7 @@ default_attributes(
     :shm_size => "6g"
   },
   :networking => {
+    :hostname => "seshat.civ.zcu.cz",
     :interfaces => {
       :external_ipv4 => {
         :interface => "ens3",