Questions tagged [ohai-gem]
41 questions
0
votes
1 answer
Debug Ohai plugins in irb shell
I've installed a chef-workstation on my computer.
ohai --version #returns: 15.7.4
I also installed the Ohai cookbook from the supermarket. If I integrate this into my test cookbook, the self-written Ohai plug-in will be executed as expected.
Now I…

user5580578
- 1,134
- 1
- 12
- 28
0
votes
2 answers
Ohai plugin_path not being loaded on Windows 10
Following Ron Cowie's guide in his book Customising Chef (O'Reilly) to creating simple Ohai plugin, it appears as though the Ohai plugins_path is not being loaded on my Windows 10 laptop.
Steps are as follows:
Create Example1.rb plugin file. I have…

Craig Roberts
- 171
- 1
- 4
- 18
0
votes
1 answer
Get Node attributes via knife
I have a requirement where I need to get hostname, memory, cores, storage, packages installed for multiple nodes(~1k).
I have approached the solution by using knife.
$ knife search node 'hostname:HostName1 OR hostname:HostName2 OR…

maverick
- 266
- 4
- 18
0
votes
1 answer
Access the Chef client/node name within an Ohai plugin
I'm trying to access node.name from a custom Ohai plugin. This doesn't seem to be available by default.
It is possible to grab the hostname by depending on that attribute with depends 'hostname', but this value may not always match that of node.name…

Chris Forbes
- 129
- 1
- 9
0
votes
0 answers
Chef node virtualization type not being detected
I have a code block that successfully detects if a VM is a VMware VM:
if node['hostnamectl']['virtualization'].include? "vmware"
include_recipe "system_baseline::vmware"
....
However if I try the same thing with AWS it does not seem to work:
if…

TyMac
- 783
- 2
- 9
- 32
0
votes
1 answer
Chef Client failed. 0 resources updated in 01 seconds - ERROR: wrong number of arguments (given 1, expected 3)
I am trying to run a simple Hazelcast cluster on Amazon EC2 following the official code sample, every step seems to be OK but when running vagrant up --provider=aws ( under the header "Let's do this thing" ) it fails as shown:
==> hazelcast2: -…

Alvaro Ruiz
- 11
- 1
- 1
0
votes
1 answer
what are the side effects of disabling ohai 'passwd' plugin
I have couple of nodes where i face '413 "Request Entity Too Large" error'. After googling, I found that we need to disable the 'passwd' ohai plugin to reduce the node data size which is being saved to Chef server - Referring to: Opscode Chef…

ReshmaA
- 85
- 1
- 3
- 12
0
votes
1 answer
How do I use the only_if for regions in EC2 instances
I'm trying to setup a only_if recipe, I only want file1 to be used in our East region and File2 to be using in the West region. The results right now is, the client bypasses the cookbook (file) because of the only_if. I looked at the logs, but they…

Devon
- 307
- 3
- 13
0
votes
1 answer
Custom ohai plugin runs but doesn't update attributes
I've written a very simple custom ohai plugin. It should just check if there are any files on the system with .war extensions. The chef client run seems to execute just fine (re-run ohai and merge results into node attributes). However, from my…

Carl_Friedrich_Gauss
- 173
- 3
- 15
0
votes
0 answers
Use Ohai data from Chef Server and not Chef Client
I know Ohai pulls data from the node on which Chef client is installed and running. It communicates this data to the Chef client. However, is there a way to pass this data back to the Chef Server? If so - how?
An old co-worker of mine had mentioned…
0
votes
1 answer
Ohai is not picking up correct ipaddress
Somehow, ohai picked up the ipaddress of one of my LXC containers on a particular host instead of the ip address associated with the eth0 interface.
$ knife node show my-obscured-host -a ipaddress
my-obscured-host:
ipaddress: 172.24.0.243
When I…
user2313505
0
votes
1 answer
How to get value of the ipaddress specified in TestKitchen using OHAI?
I am providing the ipaddress of the machine within my kitchen.yml:
- name: node_abc
driver:
network:
- ['private_network', {ip: '193.169.33.84'}]
When I try to retrieve the value of ipaddress using
ohai node[ipaddres]
I get…

meallhour
- 13,921
- 21
- 60
- 117
0
votes
1 answer
node attribute containing Chef server URL?
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

gliptak
- 3,592
- 2
- 29
- 61
0
votes
1 answer
Enable softlayer ohai plugin
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…

Anupam K
- 309
- 1
- 4
- 17
0
votes
2 answers
chef recipe doesn't find ohai plugin defined resource
I want to add additional resource 'version of installed openssh' to Ohai to use it in my openssh maintaining recipe.
On RHEL 5.11 Chef 12.4.1 Ohai 8.5.0 test workstation I have created and tested Ohai plugin
$ cat…

Alex Timo
- 1
- 2