厨房在厨师汇合之前如何运行shell命令? [英] How to run shell command before kitchen converge in chef?

查看:71
本文介绍了厨房在厨师汇合之前如何运行shell命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用流浪汉驱动程序和virtualbox提供程序来测试serverspec。
我需要先执行一些与应用程序相关的脚本,然后才能执行厨房融合。

I am using vagrant driver and virtualbox provider for testing serverspec. I need to execute some application related script before executing kitchen converge.

我尝试使用流浪者置备,但是我试图将应用程序配置与流浪者分开配置。

I have tried using vagrant provisioning, but I am trying to keep application configuration separately from vagrant configuration.

有什么方法可以将一些命令传递给厨房中的.kitchen.yml文件?

Is there any way where we can pass some commands to .kitchen.yml file in kitchen? to execute some commands before converging cookbooks.

推荐答案

如果要在主机系统上运行该命令,则有 pre_create_command 。如果您要在来宾上运行某些操作,则不支持。最好制作一份测试夹具配方或食谱,并将其添加到来宾节点的运行列表中。

If you are trying to run the command on the host system there is pre_create_command. If you mean run something on the guest, that isn't supported. You would be best off making a test fixture recipe or cookbook and adding it to the guest node's run list.

这篇关于厨房在厨师汇合之前如何运行shell命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆