Questions tagged [ohai-gem]

41 questions
0
votes
1 answer

In chef how to catch execute resource's command output in variable?

I want to use private ip address later in my Chef recipe for that how can I catch it in a variable. My code looks like... execute 'privateip' do command 'curl http://169.254.169.254/latest/meta-data/local-ipv4' action :run end I want to catch the…
Sagar Ghuge
  • 231
  • 3
  • 9
0
votes
1 answer

Iterating over a Chef array and using key in Ohai lookup

I'm iterating over an array, and would like to use the key as part of the logic to lookup an Ohai value. In my particular case, I'm attempting to source each defined user's .bashrc if triggered from a previous resource. Ohai structure: "etc": { …
Dan Stark
  • 808
  • 1
  • 9
  • 23
0
votes
2 answers

How to get stand-alone ohai to recognize custom plugin_path?

I have chef configured to add "/etc/chef/ohai_plugins" to Ohai::Config[:plugin_path]. However, the Chef documentation says: "The Ohai executable ignores settings in the client.rb file when Ohai is run independently of the chef-client." So, how can…
Creede
  • 153
  • 1
  • 11
0
votes
1 answer

Ohai thinks my plugin is version 6. Why?

I'm trying to write a plugin for ohai. It seems like a pretty straightforward task: Ohai.plugin(:Uname) do provides 'uname' depends 'kernel' collect_data do uname Mash.new uname[:message] = `uname -a` end end To me this looks like…
Creede
  • 153
  • 1
  • 11
0
votes
1 answer

Ohai: unable to get network attributes via ssh

I have several servers running centOS 6 and centOS 7. I am working in an inventory system, and for that I am using ohai, which is installed in all the machines. When I do ssh myuser@myserver.com ohai it returns a json object with all the information…
albs
  • 13
  • 4
0
votes
1 answer

How to list all volume-ids associated with ec2 instance using ruby aws-sdk?

I am stuck on listing all the volumes and volume-ids associated to ec2 instance. I am seeking to list the ebs-optimized volume attached to it. ec2 = AWS::EC2.new( :access_key_id => 'QWERTYUIOPASD', :secret_access_key =>…
liondgr8
  • 123
  • 1
  • 9
0
votes
1 answer

Not able to find ohai (~> 6.0) gem in any repository for chef-11.10.0 gem

I am trying to install chef as a gem, but due to some firewall issues need to download the .gem file and then build the gem locally in my system. For the chef gem, it requires ohai geim to be preinstalled. But the version of ohai cannot be found in…
Doel
  • 962
  • 7
  • 14
0
votes
1 answer

How to get all the members of a group in chef?

Is there a more-elegant method for getting users (in a given group) in chef than iterating over etc/passwd? I suppose I could use search functionality to get the list of group members from data bags.
Skarab
  • 6,981
  • 13
  • 48
  • 86
-1
votes
1 answer

Build Custom Ohai plugin for Windows Registry

I need to build a custom ohai plugin to read windows_registry keys and update the attributes while running the chef-client. I try to figure out on how to implement but left me more confused on how to use them?
-2
votes
1 answer

How do i access node['etc']['passwd']?

I'm trying to use the ohai resource to make node['etc']['passwd'] available. My recipe looks like this: ohai 'reload etc plugin' do plugin 'etc' action :reload end log "Was etc plugin reloaded? #{node.key?('etc')}" According to this answer…
Sören
  • 1,803
  • 2
  • 16
  • 23
-7
votes
1 answer

Chef Apache2 recipe failing during server build

I've been rebuilding our Chef master server to run in a T2 instance, which means moving it into a VPC. The old master is running 11.10.4 and the new one I've been tinkering with is running 11.16.4. I've gotten close to having it build a proper…
Machavity
  • 30,841
  • 27
  • 92
  • 100
1 2
3