New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWRP should use load_current_resource #2

Closed
jtimberman opened this Issue Jan 2, 2012 · 2 comments

Comments

Projects
None yet
3 participants
@jtimberman
Contributor

jtimberman commented Jan 2, 2012

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.

@ghost ghost assigned dje Jan 11, 2014

@josacar

This comment has been minimized.

Contributor

josacar commented Jan 19, 2014

@dje I've a branch with this almost done, the only missing things are tests for deletion and moving detection from deletion to lcr.

@josacar josacar referenced this issue Jan 19, 2014

Merged

Use load_current_resource in lwrp #15

5 of 5 tasks complete

@dje dje closed this in #15 Jan 19, 2014

@dje

This comment has been minimized.

Contributor

dje commented Jan 19, 2014

Awesome. Thanks again. I'll upload a new version to the Chef Community site tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment