Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to run custom Ohai plugins #908

Closed
mconigliaro opened this issue Apr 30, 2012 · 12 comments
Closed

Need a way to run custom Ohai plugins #908

mconigliaro opened this issue Apr 30, 2012 · 12 comments

Comments

@mconigliaro
Copy link

As far as I can tell, there is no way to specify the plugin path for Ohai. This means custom Ohai plugins cannot be loaded by the Chef provisioner.

See: http://wiki.opscode.com/display/chef/Loading+Custom+Ohai+Plugins

@mhorbul
Copy link

mhorbul commented Apr 30, 2012

There are two ways of doing that:

  1. allow to define ohai_plugins_path in the Vagrant file
  2. allow to define solo.rb template path

The second option will give user more flexibility.
What do you think it better option ? Do we really need such unlimited flexibility ?

@mconigliaro
Copy link
Author

Either works for me. Though I suspect that @mitchellh will prefer the first option, since it's similar to how cookbook and role paths are already specified.

@mhorbul
Copy link

mhorbul commented May 1, 2012

Here is the option №2 https://github.com/mhorbul/vagrant/tree/custom_template
Keep working on the option №1 :)

@jmahowald
Copy link

Definitely interested in this. Was going to hack something similar. That being said, I had pulled the fork, but didn't succeed at building it as a local gem. I'll admit I haven't done a lot of gem creation before.

Had a bit of a failure

bundle install
Using rake (0.9.2.2)
Using archive-tar-minitar (0.5.2)
Using ffi (1.0.11)
Using childprocess (0.3.2)
Using contest (0.1.3)
Using diff-lcs (1.1.3)
Using erubis (2.7.0)
Using i18n (0.6.0)
Using json (1.6.7)
Using log4r (1.1.10)
Using metaclass (0.0.1)
Using minitest (2.5.1)
Using mocha (0.11.3)
Using net-ssh (2.2.2)
Using net-scp (1.0.4)
Using rspec-core (2.8.0)
Using rspec-expectations (2.8.0)
Using rspec-mocks (2.8.0)
Using vagrant (1.1.0.dev) from source at .
Using bundler (1.1.3)
Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.
~/workspace/tools/vagrant(custom_template) $ rake
rake aborted!
no such file to load -- bundler/setup

@mhorbul
Copy link

mhorbul commented May 3, 2012

have you tried "bundle exec rake" ?

@mitchellh
Copy link
Contributor

I think for now #1 is the way to go for sure. But in the future I think arbitrary Chef config templates should be supported.

@jmahowald
Copy link

No dice for me (unless I need to go to 1.9)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S rspec test/unit/vagrant/action/builder_test.rb test/unit/vagrant/action/environment_test.rb test/unit/vagrant/action/runner_test.rb test/unit/vagrant/action/warden_test.rb test/unit/vagrant/box_collection_test.rb test/unit/vagrant/box_test.rb test/unit/vagrant/command/base_test.rb test/unit/vagrant/config/base_test.rb test/unit/vagrant/config/loader_test.rb test/unit/vagrant/config/v1/root_test.rb test/unit/vagrant/config/v1_test.rb test/unit/vagrant/config_test.rb test/unit/vagrant/data_store_test.rb test/unit/vagrant/downloaders/base_test.rb test/unit/vagrant/downloaders/file_test.rb test/unit/vagrant/downloaders/http_test.rb test/unit/vagrant/environment_test.rb test/unit/vagrant/hosts_test.rb test/unit/vagrant/plugin/v1_test.rb test/unit/vagrant/registry_test.rb test/unit/vagrant/util/ansi_escape_code_remover_test.rb test/unit/vagrant/util/file_checksum_test.rb test/unit/vagrant/util/hash_with_indifferent_access_test.rb test/unit/vagrant/util/is_port_open_test.rb test/unit/vagrant/util/line_endings_helper_test.rb test/unit/vagrant/util/network_ip_test.rb test/unit/vagrant/util/retryable_test.rb test/unit/vagrant_test.rb
INFO global: Vagrant version: 1.1.0.dev
./lib/vagrant.rb:132: undefined method each_child' for #<Pathname:/Users/josh/workspace/tools/vagrant/plugins> (NoMethodError) from /Users/josh/workspace/tools/vagrant/test/unit/base.rb:6:inrequire'
from /Users/josh/workspace/tools/vagrant/test/unit/base.rb:6
from /Users/josh/workspace/tools/vagrant/test/unit/vagrant/action/builder_test.rb:1:in require' from /Users/josh/workspace/tools/vagrant/test/unit/vagrant/action/builder_test.rb:1 from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:inload'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in load_spec_files' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:inmap'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in load_spec_files' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22:inrun'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in run_in_process' from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:inrun'
from /Library/Ruby/Gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `autorun'
from /usr/bin/rspec:19
rake aborted!

version:
git status

On branch custom_template

nothing to commit (working directory clean)
~/workspace/tools/vagrant(custom_template) $ git remote -v
origin https://github.com/mhorbul/vagrant (fetch)

@jmahowald
Copy link

Although I may have gotten around this by using the vagrant-ohai plugin from here:
git://github.com/agoddard/street-chef.git

@jmahowald
Copy link

bundle exec rake install worked fine at least when I pulled directly from the mitchellh repo and tried on 1.0.3

@johntdyer
Copy link

Was this ever solved?

@mconigliaro
Copy link
Author

For what it's worth, it looks like Opscode's ohai cookbook takes care of this somehow.

@mitchellh
Copy link
Contributor

I recently commited 56adfec which will be part of the next Vagrant release (1.2.4 or 1.3.0) that allows custom configuration to be set for Chef, allowing you to do this sort of thing.

@ghost ghost locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants