//
archives

lwrp

This tag is associated with 2 posts

Multiple resources in LWRPs

In my smartos_zones cookbook I have two different resource types but a single provider. I wanted to highlight what I had to do to detect which was used. I have a KVM and a Zone resource, in the provider’s load_current_resource I have: Get restype looks like this: Fairly simple, but took me a bit of … Continue reading

Ruby Class method to test for truth

I needed to test for truth in a Ruby class in my Chef LWRP cookbook and I wanted to use the question mark (?). Simple way to do it in a resource library: Now in the provider I can do: … if @new_resource.jdk_reinstall? … This is just a snippet reminder, if someone wants more context … Continue reading