Tuesday, 27 August 2013

Unable to wrap my head around Chef LWRPs

Unable to wrap my head around Chef LWRPs

I've been working with chef for a few days now and I'm finally starting to
build out my applications environment, however I'm having issues wrapping
my head around the use of Chef LWRPs.
Using the chef-user cookbook as an example. How would I go about creating
a new user account? I understand the concept of storing information about
the user in data bags, etc. I'm just not sure where I should be defining
LWRPs.
For instance, in the examples section on the chef-user site, a user
account is created with:
user_account 'hsolo' do
comment 'Han Solo'
ssh_keys ['3dc348d9af8027df7b9c...', '2154d3734d609eb5c452...']
home '/opt/hoth/hsolo'
end
The code makes sense, except I don't see what the file should be called,
or where it should be placed. The documentation around LWRPs tells me I
should be extending functionality by placing the resources in resources/.
Does that mean I should be modifying the cookbook itself, or creating a
cookbook to manage the cookbook? Both seem wrong.
Any help would be greatly appreciated!

No comments:

Post a Comment