Vagrant: Unknown configuration section 'omnibu

2019-06-25 00:03发布

I've followed the instructions at: http://berkshelf.com/ after installing the latest ChefDK (from here: http://downloads.getchef.com/chef-dk/mac/#/). When I do "vagrant up", I get the error:

Vagrant:
* Unknown configuration section 'omnibus'.

Various posts (e.g. Vagrant Install chef-client on top of base image) have suggested this means that the vagrant-omnibus plugin is not installed. In my case, I have installed it. "vagrant plugin list" displays:

vagrant-berkshelf (2.0.1)
  - Version Constraint: 2.0.1
vagrant-login (1.0.1, system)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.1, system)

Any suggestions as to how I can get this example cookbook to run on a new VM instance launched with "vagrant up"?

2条回答
贼婆χ
2楼-- · 2019-06-25 00:37

I personally went inside the vagrant file using VI editor and commented out the line that has omni bus script and then run " vagrant status" and then "vagrant up"

1.vi Vagrant 2.?omnibus 3."insert" I omnibus 4.insert # to comment out the line 5. wq! to come out of vi editor

** this issue can also be related with the type of OS one is using ,i am using a mac

查看更多
够拽才男人
3楼-- · 2019-06-25 00:41

It turns out the issue for me was that while ~/.vagrant.d/plugins.json included the vagrant-omnibus plugin, the ~/.vagrant.d/gems/gems and ~/.vagrant.d/gems/specifications directories did not contain the appropriate GEM or gemspec files. Not sure how this happened, but I suspect it was due to accidentally typing ^C in the middle of execution of the vagrant plugin install command and then reexecuting that command.

It would appear vagrant plugin install does not do appropriate ^C handling and that it writes the contents of plugins.json before it has stored the gem and gemspec.

Subsequent vagrant plugin install commands don't fix the problem. Manually editing plugins.json to remove the plugin and then reexecuting the vagrant plugin install vagrant-omnibus command fixed the issue.

查看更多
登录 后发表回答