iT邦幫忙

0

Vagrant Plugins

Plugin 安裝,以 vbinfo 為例

$ vagrant plugin install vbinfo

使用 vbinfo plugin

$ vagrant vbinfo
/opt/vagrant/embedded/lib/ruby/2.4.0/find.rb:43:in `block in find': No such file or directory - /home/doraemon/.vagrant (Errno::ENOENT)
        from /opt/vagrant/embedded/lib/ruby/2.4.0/find.rb:43:in `collect!'
        from /opt/vagrant/embedded/lib/ruby/2.4.0/find.rb:43:in `find'
        from /home/doraemon/.vagrant.d/gems/2.4.9/gems/vbinfo-0.0.2/lib/command.rb:22:in `ids'
        from /home/doraemon/.vagrant.d/gems/2.4.9/gems/vbinfo-0.0.2/lib/command.rb:98:in `execute'
        from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/cli.rb:66:in `execute'
        from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/environment.rb:290:in `cli'
        from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/bin/vagrant:182:in `<main>'

列出已安裝的 plugin

$ vagrant plugin list

移除 plugin

$ vagrant plugin uninstall vbinfo
Uninstalling the 'vbinfo' plugin...
Successfully uninstalled mixlib-shellout-2.4.4
Successfully uninstalled vbinfo-0.0.2

徹底全部移除 plugin

$ vagrant plugin expunge

This command permanently deletes all currently installed user plugins. It
should only be used when a repair command is unable to properly fix the
system.

Continue? [N]: Y

All user installed plugins have been removed from this Vagrant environment!

徹底全部移除 plugin 後再全部重新安裝

$ vagrant plugin expunge --reinstall
$ vagrant plugin --help
Usage: vagrant plugin <command> [<args>]

Available subcommands:
     expunge
     install
     license
     list
     repair
     uninstall
     update

For help on any individual command run `vagrant plugin COMMAND -h`


Plugins 清單:
https://github.com/hashicorp/vagrant/wiki/Available-Vagrant-Plugins


老師推薦的 Vagrant plugins:

  • vagrant-vbguest
  • vagrant-winnfs(僅 Windows 適用)
  • vagrant-hostmanager
  • vagrant-netinfo
  • vagrant-git

尚未有邦友留言

立即登入留言