title: how to pass ohai hints through chef knife bootstrap command
body: <p>I need to disable the passwd plugin in my chef-client environment to avoid a FATAL error due to the large number of users.</p>
  
  <p>The way I did for the local client is to add the following line to the client.rb file:</p>
  
  <pre><code>ohai[:disabled_plugins] = ["passwd"]
  </code></pre>
  
  <p>When bootstrapping a managed node, I would  like to have the same done through the knife bootstrap command to the managed node.  From the knife doc, here is the syntax:</p>
  
  <blockquote>
    <p>--hint HINT_NAME[=HINT_FILE]</p>
  </blockquote>
  
  <p>An Ohai hint to be set on the target of the bootstrap. The hint is contained in a file and is formatted as JSON: <code>{"attribute":"value","attribute":"value"...}</code>. HINT_NAME is the name of the hint and HINT_FILE is the name of the hint file located at </p>
  
  <blockquote>
    <p>/etc/chef/ohai/hints/HINT_FILE.json</p>
  </blockquote>
  
  <p>Use multiple --hint options in the command to specify multiple hints.</p>
  
  <p>This is what I did:</p>
  
  <p>On the chef workstation, under /etc/chef/ohai/hints/HINT_FIILE.jason, it has the following content:</p>
  
  <pre><code>{disabled_plugins:["passwd"]}
  </code></pre>
  
  <p>Here is the knife bootstrap command:</p>
  
  <blockquote>
    <p>knife bootstrap [managed_node_name] --hint disabled_plugins -sudo -x
    user -P [password] -N "test_node"</p>
  </blockquote>
  
  <p>When the command is completed, on the managed_node,  a new file is created:   /etc/chef/ohai/hints/disabled_plugins.json, with the following content:</p>
  
  <blockquote>
    <p>{}</p>
  </blockquote>
  
  <p>This doesn't seem right...</p>
  
  <p>Any idea what I did wrong?</p>