node attribute containing Chef server URL?

1k Views Asked by At

Would Chef server URL be accessible as an attribute of a node? I would like to have a custom recipe behaviour changed based on the server id (URL) the node is connected to.

https://docs.chef.io/ohai.html doesn't list server (URL) provided.

Thanks

1

There are 1 best solutions below

2
On BEST ANSWER

The chef_server_url config setting is not available as a node attribute, but you can access this configuration via Chef::Config:

Chef::Config['chef_server_url']