WARN:Node <nodename>有一个空 运行 list.But 我添加了一个 运行 列表到节点?

WARN:Node <nodename>has an empty run list.But I have added a runlist to the node?

作为 Chef 的新手,我开始编写示例食谱以在节点上创建文件。 下面是我的 default.rb 文件

中的代码
file 'home/ubuntu/sample.txt' do
  content 'this is test content'
  mode '0755'
end

我把菜谱上传到服务器了,请看下面的截图:

我还在特定节点下的runlist中添加了cookbook。当我尝试切割 bootstrap 节点时,我收到一条警告,指出运行列表为空。我无法弄清楚缺少什么。下面是我正在使用的bootstrap命令

sudo knife bootstrap xx.xx.xx.xx --ssh-user ubuntu -i /home/ubuntu/keys/keyname.pem --sudo --use-sudo-password <password> -N testnodelatest

执行上述命令时的输出:

 Starting the first Chef Client run...
54.40.1.69 Starting Chef Client, version 12.18.31
54.40.1.69 resolving cookbooks for run list: []
54.40.1.69 Synchronizing Cookbooks:
54.40.1.69 Installing Cookbook Gems:
54.40.1.69 Compiling Cookbooks...
54.40.1.69 [2017-02-14T01:36:22-05:00] WARN: Node testnodelatest has an empty run list.
54.40.1.69 Converging 0 resources
54.40.1.69
54.40.1.69 Running handlers:
54.40.1.69 Running handlers complete
54.40.1.69 Chef Client finished, 0/0 resources updated in 01 seconds

您的 knife bootstrap 命令未指定 运行 列表 (-r)。由于这启动了 Chef 运行,因此它被用作第一个 运行 的 运行 列表。

我发现您已经添加了一个 运行 列表 "under the specific node"(我想是在您的 Chef Server 中吧?),这有点奇怪。如果该节点已经在 Chef 服务器上注册,那么就不要使用 bootstrap 命令。相反,只需在节点上 运行 chef-client