heavywater/chef-dnsimple — Issue #2: LWRP should use load_current_resource
Author: jtimberman
Created: 2012-01-02 05:18:01+00:00
State: open

I think the provider should use the load_current_resource method to determine if the record exists prior to attempting to create or destroy it. I wrote some prototype code a week or so ago, but I seem to have lost the changes I made. The idea is:

1. Add load_current_resource (aka lcr) method in provider.
2. Move the current detection code up to lcr.
3. Add a resource attribute, `exists` that is false by default, but true if the matching record is found.
4. Both action methods would check for existence, and behave accordingly.

While the current detection with name, value and ttl "works", it may not be as reliable for detecting different types of DNS records. I haven't done any testing of this yet, however.