0

I wanted to enable the softlayer ohai plugin so that the softlayer metadata will be collected.

I have included the ohai recipe in the chef node's run list. I can see it when I run

knife node show NODE_ID

The softlayer.rb file seems to be missing on the chef node at /opt/chef/embedded/apps/ohai/lib/ohai/plugins. Lots of plugins are missing at that location. What might be wrong? What do I need to do to collect the softlayer metadata ?

StephenKing
  • 36,187
  • 11
  • 83
  • 112
Anupam K
  • 309
  • 1
  • 4
  • 17

1 Answers1

1

You need to give ohai a hint. Therefore, create a file called /etc/chef/ohai/hints/softlayer.json with content {}.

Then, this check should trigger calls to the metadata service, which finally populates the automatic attributes.

For debugging purpose, try on the node:

ohai softlayer

After the chef run, these automatic attributes can be read from the chef server with:

knife node show <nodename> -a softlayer
StephenKing
  • 36,187
  • 11
  • 83
  • 112
  • running ohai softlayer on node gave error "ERROR: Encountered error while running plugins: # – Anupam K Feb 23 '16 at 17:09
  • Probably because your chef version does not yet include this plugin. See my comment above. – StephenKing Feb 23 '16 at 17:11
  • Is there any way by which we can get the softlayer metadata with chef-version 12.1.2 ? – Anupam K Feb 23 '16 at 17:21
  • 1
    I did not compare the code in detail, but @coderanger's [ohai-softlayer cookbook](https://github.com/coderanger/ohai-softlayer) looks very similar. – StephenKing Feb 23 '16 at 18:08
  • Thanks .. I installed the https://github.com/coderanger/ohai-softlayer cookbook I can see that /etc/chef/ohai_plugins/softlayer.rb file ... I ran the command knife node show -a softlayer and knife node show -a ohai-softlayer .. It did not show anything ... how to see all the softlayer attributes ? – Anupam K Feb 24 '16 at 15:13
  • Great. What was the mistake before? – StephenKing Feb 24 '16 at 18:19
  • I forgot to run knife node run_list add ohai-softlayer :P – Anupam K Feb 24 '16 at 18:55
  • hi , I dont want the user_metadata attribute to be sent to chef_server. What is the best way to do this ? – Anupam K Feb 26 '16 at 08:31