Vagrant-SSH响应非零退出状态

Vagrant-SSH响应非零退出状态,vagrant,puppet,Vagrant,Puppet,基于上述情况,我无法计算出实际失败的原因是什么?Nginx正在按预期运行。在您的情况下,没有任何失败。当Puppet成功应用导致系统更改的目录时,返回的退出代码为2。Vagrant将所有非0的ssh退出代码解释为意外和隐含的故障。Puppet在此实例中为退出代码返回了2,Vagrant将其解释为失败 我建议在Puppet执行之后添加一个配置行,该行对shell执行echo$?。这将为Vagrant提供所需的0返回代码,同时还允许您查看实际代码并验证它是2 ==> payment: Noti

基于上述情况,我无法计算出实际失败的原因是什么?Nginx正在按预期运行。

在您的情况下,没有任何失败。当Puppet成功应用导致系统更改的目录时,返回的退出代码为
2
。Vagrant将所有非
0
的ssh退出代码解释为意外和隐含的故障。Puppet在此实例中为退出代码返回了
2
,Vagrant将其解释为失败

我建议在Puppet执行之后添加一个配置行,该行对shell执行
echo$?
。这将为Vagrant提供所需的
0
返回代码,同时还允许您查看实际代码并验证它是
2

==> payment: Notice: /Stage[main]/Nginx::Service/Service[nginx]/ensure: ensure changed 'stopped' to 'running'
==> payment: Info: /Stage[main]/Nginx::Service/Service[nginx]: Unscheduling refresh on Service[nginx]
==> payment: Info: Stage[main]: Unscheduling all events on Stage[main]
==> payment: Info: Creating state file /opt/puppetlabs/puppet/cache/state/state.yaml
==> payment: Notice: Applied catalog in 219.19 seconds
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
根据需要将
config
替换为本地Ruby块变量

config.vm.provision 'shell', inline: 'echo $?'