Pergunta

I am trying to use backup-cookbook, and it's my first time trying to use the resource.

However when I try to call the resource "backup_model" it complains "Cannot find a resource for backup_model". So I know I must have put it in the wrong place.

I use librarian-chef. I am using chef-solo on a local Vagrant server.

site-cookbooks/c/recipes/default.rb

backup_model :ct_backup do
  ...
end

roles/backup.rb

name "backup"
description "Backup role."
run_list(
  "role[base]",
  "recipe[backup-cookbook]"
)

node.json

{
  "run_list":[
    "role[base]",
    "role[backup]",
    "recipe[c]"
  ]
}

When I try to run knife solo cook I got the following errors:

NameError
---------
Cannot find a resource for backup_model on ubuntu version 12.04


Cookbook Trace:
---------------
  /home/chefy/chef-solo/cookbooks-2/ct/recipes/default.rb:33:in `from_file'
Foi útil?

Solução

I made the stupid mistake that in the Cheffile I used

cookbook 'backup-cookbook', git: 'git@github.com:gofullstack/backup-cookbook.git'

But the correct name should be:

cookbook 'backup',  git: 'git@github.com:gofullstack/backup-cookbook.git'
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top