bearrito
bearrito

Reputation: 2325

Using a custom LWRP in Chef

I'm trying to write a custom LWRP for deploying flask applications.

I've referenced the following cookbook extensively :

https://github.com/opscode-cookbooks/application_python

I have the following in my recipe

application "packaginator" do
  path "/my/apps/packaginator"
  owner "root"
  group "root"
  repository "https://github.com/coderanger/packaginator.git"
  revision "master"
  migrate false
  packages ["libpq-dev", "git-core","python-pip"]

  flask do
    packages ["boto"]
  end
end

Inside of my cookbooks recipe folder I have a file named flask.rb that contains the resource definition.

Likewise in my cookbooks provider folder I have a file named flask.rb that is the provider.

Whenever I try to apply the recipe on my vagrant box I receive the following :

FATAL: NameError: No resource found for flask. Tried application_flask, flask

This is my first custom LWRP so what simple steps am I missing so that I can use my custom lwrp?

Upvotes: 0

Views: 1232

Answers (1)

Draco Ater
Draco Ater

Reputation: 21226

Your flask.rb should be not in recipe folder, but in resource folder. Then you can reference it in your recipe as application_flask.

Upvotes: 1

Related Questions