How to find the definition "openstack_identity_register" in the cookbook


#1

Hi guys,

I am just learning how to use chef and trying to understand the keystone
recipes at

For the recipe registration.rb, I can understand most of the content except
the structure “openstack_identity_register”. I think the word
"openstack_identity_register" should have a definition at somewhere, so I
tried to search the definition at the whole cookbook
"cookbook-openstack-identity" but failed.

I am wondering where is the definition so that I can understand what
happened in the structure “openstack_identity_register”.

Much appreciated for any comment.

Thanks,
Sam


#2

On Monday, September 16, 2013 at 8:43 AM, Sam Su wrote:

Hi guys,

I am just learning how to use chef and trying to understand the keystone recipes at
https://github.com/stackforge/cookbook-openstack-identity/blob/master/recipes

For the recipe registration.rb, I can understand most of the content except the structure “openstack_identity_register”. I think the word “openstack_identity_register” should have a definition at somewhere, so I tried to search the definition at the whole cookbook “cookbook-openstack-identity” but failed.

I am wondering where is the definition so that I can understand what happened in the structure “openstack_identity_register”.

Much appreciated for any comment.

Thanks,
Sam
This is a LWRP (lightweight resource and provider) that comes bundled with the cookbook. The resource file declares the available fields:
https://github.com/stackforge/cookbook-openstack-identity/blob/master/resources/register.rb

And the provider is the implementation:
https://github.com/stackforge/cookbook-openstack-identity/blob/master/providers/register.rb

The docs for LWRPs are here: http://docs.opscode.com/lwrp_custom.html

HTH,


Daniel DeLeo


#3

Great, thank you so much.

–Sam

On Mon, Sep 16, 2013 at 11:56 PM, Daniel DeLeo dan@kallistec.com wrote:

On Monday, September 16, 2013 at 8:43 AM, Sam Su wrote:

Hi guys,

I am just learning how to use chef and trying to understand the keystone
recipes at

https://github.com/stackforge/cookbook-openstack-identity/blob/master/recipes

For the recipe registration.rb, I can understand most of the content
except the structure “openstack_identity_register”. I think the word
"openstack_identity_register" should have a definition at somewhere, so I
tried to search the definition at the whole cookbook
"cookbook-openstack-identity" but failed.

I am wondering where is the definition so that I can understand what
happened in the structure “openstack_identity_register”.

Much appreciated for any comment.

Thanks,
Sam

This is a LWRP (lightweight resource and provider) that comes bundled
with the cookbook. The resource file declares the available fields:

https://github.com/stackforge/cookbook-openstack-identity/blob/master/resources/register.rb

And the provider is the implementation:

https://github.com/stackforge/cookbook-openstack-identity/blob/master/providers/register.rb

The docs for LWRPs are here: http://docs.opscode.com/lwrp_custom.html

HTH,


Daniel DeLeo