在哪里必须以本地模式指定运行列表? [英] Where do I have to specify the run-list in local-mode?

查看:79
本文介绍了在哪里必须以本地模式指定运行列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置Chef-Client知道run_list每15分钟运行一次?

How can in configure the chef-client to know the run_list to run every 15min?

我以 chef-client --local-mode -j run_list.json启动厨师客户端,该服务器可以正常工作。

I start the chef-client run with "chef-client --local-mode -j run_list.json" which works as expected.

要每15分钟提供一次厨师运行,我将厨师客户端菜谱添加为依赖项。在日志文件中,我可以看到厨师运行每15分钟启动一次(以本地模式运行),但是每次运行run_list都是空的。

To provide a chef run every 15min, I add the chef client cookbook as dependency. In the log file I can see that the chef run starts (in local mode) every 15min, but the run_list is empty for every further run.

在哪里添加信息,第二个厨师运行应该使用与第一次运行相同的运行列表?我在client.rb文件中找不到任何地方。

Where do I have to add the information that the second chef-run should use the same run-list as in the first run? I couldn`t find any place in the client.rb file.

推荐答案

您可以在json文件中定义自己的属性,并将其用作 chef的一部分-client 运行。

you can define you own attributes within a json file and use it as a part of the chef-client run.

例如,有一个名为 attrs.json 的json文件看起来像这样:

for instance, having an json file named attrs.json that look like:

{
  "run_list": [
    "'recipe[base::default]'"
  ]
}

使用厨师-client 与[-json属性结合使用,例如:

use chef-client in conjunction with [--json-attributes, something like:

chef-client --local-mode --json-attributes /path/to/attrs.json

或者您可以将首席客户端-runlist结合使用

chef-client --local-mode --runlist 'recipe[base::default]'

如果 node_path 设置用于厨师客户端配置中, client.rb ,在 chef-client 运行,将 node.json 文件写入 node_path ,可用作定期执行的状态。

if the node_path setting is used in chef-client confiugration, client.rb, after chef-client run, a node.json file will be written to the node_path, which can be used as a presistency for a periodically execution.

这篇关于在哪里必须以本地模式指定运行列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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