问题标签 [vagrant-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
456 浏览

vagrant - 多机 vagrantfile 中的 Shell 配置

如何配置在多机 vagrant 文件中创建的 VM。我想在创建的每台机器上执行单独的 shell 配置脚本。我无法弄清楚 vagrant 是如何促成这一点的。

显然,在运行上述 vagrant 脚本时,我从 vagrant 收到以下错误消息。

非常感谢任何帮助。

0 投票
1 回答
110 浏览

vagrant - 如何创建从 vagrant 到特定虚拟机的 ssh 连接?我可以创建与安装在 WMware 上的 VM 的连接吗?

我在VagrantApache Storm中绝对是新人。

我正在关注一个在线课程,其中显示以下情况。

1)在 Virtual Box 上安装了一个 Ubuntu 虚拟机 2)在物理机上(安装 Virtual Box 和运行 Ubuntu VM 的位置相同)它安装了Vagrant

好的,从物理机,它使用以下语句登录到虚拟机:

并显示它已创建到已安装的 Ubuntu VM 的连接。

这里的第一个疑问:它如何知道确切的虚拟化系统是什么?如果我在 Virtual Box 上安装了多个 VM,会发生什么情况(使用上一个命令未指定必须连接的已安装 VM)

另一个疑问是:我不使用 Virtual Box 但我使用WMware 工作站?如何使用vagrand ssh命令创建与安装在 WMware 工作站上的特定 VM 的连接?

0 投票
2 回答
555 浏览

vagrant - 无法在 Windows 上安装 vagrant-cachier 插件

我是新手vagrant

我已经安装了virtualbox和vagrant(1.7.4)然后按照书的类型

几分钟后,它报告了一个错误:

ruby我对此知之甚少gem。在安装插件之前是否需要安装其他任何东西?
或者可能是网络问题?(我在家里和办公室都试过,同样的错误)
vagrant 工作正常,我可以正常启动、启动和 ssh。

0 投票
2 回答
1870 浏览

ruby - 如何在 Ubuntu 14.04 中为 Vagrant 安装 Ruby 版本 >= 2.0?

我有一个正在运行的EC2实例。它将使用插件运行和部署一些虚拟机。但是每次我尝试安装插件时都会出现以下错误:AmazonUbuntu 14.4.3Vagrantvagrant-aws

Ubuntu我的机器上有相同的版本,desktop没有这个问题。我究竟做错了什么 ?我试图ruby1.9仅删除和安装ruby2.2,但仍然给出相同的错误。

编辑

Vagrant 安装 ruby​​1.9,即使我安装了较新的版本!

然后,再次出现同样的错误:

0 投票
2 回答
317 浏览

vagrant - 如何安装 vagrant-sphere 插件

我有 vagrant 1.7.2 并且我需要 vagrant-vsphere 插件但是当我尝试命令时:vagrant pluging install vagrant-vpshere显示这些错误消息:

在这些错误之后,我手动安装了 gem vagrant-share 1.1.4 但我发现 vagrant 有插件 vagrant-share 1.1.3 作为系统插件:

问题:如何以与 vagrant 1.7.x 一致的方式安装 vagrant-sphere 插件?

0 投票
1 回答
2868 浏览

bash - Vagrant:如何通过 guest shell 中的命令在主机上运行脚本?

可以打开端口、网络文件,并且有插件允许在 Vagrant 的 Provisioning 过程中运行来宾或主机 [shell] 命令。

我想做的是能够(可能通过 bash 别名)在 Vagrant 来宾/VM 中运行命令,并让它在主机上执行命令,理想情况下在命令行上传递一个变量。

示例:在我的主机中,我运行 Atom 编辑器(同样适用于 TextMate,无论如何)。如果我想处理 VM 中的共享文件,我必须从主机中手动打开该文件,方法是直接在编辑器中打开它,或者运行“atom filename”shell 命令。

我想要奇偶校验,所以在虚拟机内部时,我可以运行“原子文件名”,这会将文件名传递给虚拟机外部的“原子 $1”脚本,在主机中,并在我的主机编辑器(Atom)中打开它.


注意:我们使用 Salt 进行 Vagrant Provisioning,并使用 NFS 进行挂载,这是值得的。当然,使用密钥 ssh。

奖励问题:使用 .gitconfig 作为其合并冲突编辑器使其工作(如果前者可行,应该可以工作,对吧?)。

0 投票
2 回答
2057 浏览

vagrant - 使用 NFS 错误权限的 Vagrant 同步文件夹

尝试将NFS插件与 Vagrant 中的同步文件夹一起使用,并且它正在工作,除了在来宾(VM)中权限错误:

我尝试根据 Vagrant 文档设置uidand :gidVagrantfile

我希望在来宾中使用正确的用户/组,但它仍在使用501and dialout

有任何想法吗?

0 投票
1 回答
197 浏览

vagrant - Vagrant 插件:如何捕获 machine.action 输出

我开始为 Vagrant 编写一个插件,它将添加一个命令。在 Command#execute 中,我需要捕获 :ssh_run 输出。现在输出直接到标准输出。命令中的小测试片段:

有谁知道怎么做?也许 vm.action 本身不是正确的方法?

非常感谢提前

塞巴斯蒂安

0 投票
1 回答
894 浏览

ruby - How can I programmatically query Vagrant for its provisioning status?

The Goal

I am attempting to conditionally run the vagrant-berkshelf plugin. By default, enabling the plugin causes Berkshelf to resolve and vendor cookbooks on every single vagrant up (which is a relatively expensive operation) even if the current vagrant operation isn't a provisioning run. For example, I expect Berkshelf to run when I run:

  • vagrant up the first time, or
  • when I execute vagrant reload --provision.

The source implies there ought to be a way to query Vagrant itself to determine if it's a provisioning run. Specifically, there ought to be a way to hook into @env[:provision_enabled] or vagrant.actions.vm.provision, but I'm unable to figure out how to do this from within the Vagrantfile itself.

Is this method actually bound to the Vagrant object? If not there, then where? And how can I introspect it?

Software Versions

  • Vagrant 1.8.1
  • vagrant-berkshelf 4.1.0

What I've Tried

As a workaround, I have tried moving the Berkshelf plugin inside the Chef block, intending that it only run when the Chef provisioner does. For example:

However, Berkshelf still runs every time I vagrant up or vagrant reload, which is not the desired behavior. The cookbooks are still resolved and vendored on each run. Consider the following elided output:

==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Using karaf (0.2.1)
==> default: Vendoring karaf (0.2.1) to /Users/foo/.berkshelf/vagrant-berkshelf/shelves/berkshelf20160215-19428-unzcx1-default/karaf

Questions That Aren't Duplicates of This One

There is a vaguely related question where the accepted answer is an ugly hack that looks for the presence of .vagrant/machines/default/virtualbox/action_provision or similar, but it is not an exact duplicate of this question as it doesn't address how to programmatically query Vagrant's internal state through the runtime objects or API Vagrant exposes. It may hold a pragmatic (if kludgey) answer based on filesystem semaphores, but it does not answer the question I'm actually asking.

0 投票
3 回答
132 浏览

vagrant - 守护 vagrant 插件的首选方法

是否有首选方法来守护vagrant 插件

我正在使用vagrant-fsnotify它在主机上运行一个进程以将文件更改事件从主机发送到来宾。