Skip to content
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

Idempotent DNS Add/Remove #53

Open
sufyanadam opened this issue Oct 28, 2019 · 4 comments
Open

Idempotent DNS Add/Remove #53

sufyanadam opened this issue Oct 28, 2019 · 4 comments

Comments

@sufyanadam
Copy link

Is there an option we can pass so that cfcli add -t CNAME some-cname some-host does not fail if the record exists already? Maybe log a message that the record already exists. This would be helpful while building automations. Same for remove behaviour. Would this be possible?

@danielpigott
Copy link
Owner

Sorry for the delay in responding to this, I haven't been working on this project at all. I could probably add a flag to ignore failures. Will look at doing that as part of the next update

@lapwat
Copy link

lapwat commented Aug 3, 2021

@sufyanadam
Maybe you can ignore the error in your bash command:

cfcli add -t CNAME some-cname some-host || true

@sufyanadam
Copy link
Author

@lapwat that's what I'm doing for now.

@sufyanadam
Copy link
Author

@lapwat @danielpigott ignoring the error with || true doesn't work for cases where you don't want the error ignored. For example creating the record failed due to invalid or empty DNS parameters. When building automations you want to know if there was something wrong with the input vs it already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants