对资源“ cookbook_file”执行操作“创建”时出错

时间:2019-04-09 19:34:26

标签: chef-recipe

在资源上执行操作“创建”时出错。我正在--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:

1 个答案:

答案 0 :(得分:0)

您的cookbook_files的默认位置在files/default中。您得到的错误是您的食谱文件不存在。您可以创建文件files/default/motd并重新运行您的Chef-Client吗?