Simplify and improve chef attribute handling

Set the attributes in a Ruby file under /etc/chef/client.d/ instead of
editing /etc/chef/client.rb
Now uses the new whitelist attribute:
https://docs.chef.io/client/19/cookbooks/attributes/attribute_persistence/

Local chef config also uses the same file. That means there is no longer
a need to use the sanitize script to remove override and default
attributes from nodes.
This commit is contained in:
2026-07-11 17:24:45 +02:00
parent 736d4effa4
commit 1759af98b8
4 changed files with 32 additions and 76 deletions
@@ -0,0 +1,8 @@
allowed_automatic_attributes ["fqdn", "os", "os_version", "hostname",
"ipaddress", "roles", "recipes", "ipaddress",
"platform", "platform_version", "cloud",
"cloud_v2", "chef_packages", "zerotier"]
allowed_default_attributes []
allowed_override_attributes []
allowed_normal_attributes ["knife_zero", "kosmos_kvm", "kosmos-ejabberd",
"openresty", "vm_host"]
@@ -1,6 +0,0 @@
---
- knife_zero
- kosmos_kvm
- kosmos-ejabberd
- openresty
- vm_host