It turns out I can't check for a node(host) name in Chef, so I'm trying to figure out the best way to make the following happen:
If hostname is X
ldap_access_filter = memberOf=<%= node['sssd_ldap']['ldap_access_node_filter'] %>
else
ldap_access_filter = memberOf=<%= node['sssd_ldap']['ldap_access_filter'] %>
end
The idea is that when the node name (or some matching variable) is true, then it uses the ldap_access_node_filter, which is a unique value, else, it uses the default value. I'm basically configuring sssd config, and one of the hosts requires a special ldap access filter.
If there is a better way, please let me know.
Please help.
Ohai should allow you to get hostname?
If you want something node specific it seems like you could just plug in to the attribute precedence in chef. You would set a default value for the attribute maybe at the cookbook level and then set an explicit attribute on the node. It also means if you need 2 of these servers to have the value you don't change the cookbook just the config on the servers.