在资源'cookbook_file上执行动作`create`时出错

问题描述 投票:0回答:1

在资源上执行“创建”操作时出错。我在--local-mode中运行配方,不确定是否存在问题。

我只是尝试在本地运行它而不是在节点上运行它。

在此处粘贴我的文件和输出:

[2019-04-09T19:25:51+00:00] WARN: Node rheaj has an empty run list.
Converging 4 resources
Recipe: @recipe_files::/home/rheaj/chef/cookbooks/oc_jumpbox/recipes/default.rb
  * cookbook_file[/etc/motd] action create[2019-04-09T19:25:51+00:00] INFO: Processing cookbook_file[/etc/motd] action create (@recipe_files::/home/rheaj/chef/cookbooks/oc_jumpbox/recipes/default.rb line 9)


    ================================================================================
    Error executing action `create` on resource 'cookbook_file[/etc/motd]'
    ================================================================================

    Chef::Exceptions::CookbookNotFound
    ----------------------------------
    Cookbook @recipe_files not found. If you're loading @recipe_files from another cookbook, make sure you configure the dependency in your metadata

    Resource Declaration:
    ---------------------
    # In /home/rheaj/chef/cookbooks/oc_jumpbox/recipes/default.rb


      9: cookbook_file '/etc/motd' do
     10:   group 'root'
     11:   user 'root'
     12:   mode '0644'
     13:   source 'motd'
     14: end
     15:
chef-recipe
1个回答
0
投票

cookbook_files的默认位置在files/default。你得到的错误是你的食谱文件不存在。你能创建该文件files/default/motd并重新运行你的厨师 - 客户端。

© www.soinside.com 2019 - 2024. All rights reserved.