title: How to set Node Attributes on a Chef Client?
body: <p>I'm using the <a href="https://github.com/opscode/cookbooks/tree/master/chef-client" rel="nofollow">chef-client cookbook</a> to configure a machine as a chef client . How do I configure node attributes when this client is created ?</p>
  
  <p>I do not want to do <code>knife node edit</code> . My aim is to set some node attributes when creating this node, probably by adding something to a JSON file.</p>
  
  <p>UPDATE:</p>
  
  <p>I am creating hundreds of nodes which will use this script (<a href="https://gist.github.com/4076949" rel="nofollow">see the gist</a>) to bootstrap chef-clients.  Node_name which is in the script will be different for each node. Similarly I want to set a custom attribute to the node that will group them together. </p>
  
  <p>Say for example I want to group all the nodes belonging to a particular project together. I was thinking I will add an attribute "project_id" to the Node. So that I can search later for all nodes belonging to a project. This is especially useful for deployments - while trying to find out all db_master roles / webserver roles / memcached roles belonging to a particular project .</p>
  
  <p>So what I want to do is this : there should be some placeholder in the script (which you saw in the gist) where I can add custom attributes like project_id or whatever to the Node. Is that possible ?</p>