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

cloudflare_dns: add support for comment and tags #9132

Merged
merged 7 commits into from
Nov 24, 2024

Conversation

Sergio-IME
Copy link
Contributor

SUMMARY

Add support for comment and tags fields to Cloudflare DNS module as it's allowed by their API https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-create-dns-record

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cloudflare_dns

ADDITIONAL INFORMATION

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) labels Nov 15, 2024
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Nov 15, 2024
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Nov 15, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-10 Automatically create a backport for the stable-10 branch labels Nov 16, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@russoz
Copy link
Collaborator

russoz commented Nov 17, 2024

Hi @Sergio-IME

Other than the comments already left by Felix, it looks good to me.

Cheers, AZ

PS: "IME" as in "IME-USP" ?

@Sergio-IME
Copy link
Contributor Author

Hi

Other than the comments already left by Felix, it looks good to me.

last commits address the changes, not sure why they aren't detected as outdated hmm

PS: "IME" as in "IME-USP" ?

no, not related 🙂

@felixfontein
Copy link
Collaborator

If nobody objects, I'll merge this at the end of this week!

@@ -826,6 +876,10 @@ def ensure_dns_record(self, **kwargs):
do_update = True
if (params['type'] == 'CNAME') and (cur_record['content'] != new_record['content']):
do_update = True
if cur_record['comment'] != new_record['comment']:
do_update = True
if sorted(cur_record['tags']) != sorted(new_record['tags']):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular preference, just a note that this could be also achieved by:

Suggested change
if sorted(cur_record['tags']) != sorted(new_record['tags']):
if set(cur_record['tags']) != set(new_record['tags']):

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Nov 24, 2024
@felixfontein felixfontein merged commit 3c23ce4 into ansible-collections:main Nov 24, 2024
129 checks passed
Copy link

patchback bot commented Nov 24, 2024

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/3c23ce4a7bcdd08e172a58669842d4faec63d7c5/pr-9132

Backported as #9184

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 24, 2024
* `cloudflare_dns`: add support for `comment` and `tags`

* `cloudflare_dns`: add return values for `comment`/`tags` fields

* `cloudflare_dns`: fix return values samples

* `cloudflare_dns`: changelog fragment formatting

* `cloudflare_dns`: add missing `version_added`

* `cloudflare_dns`: remove explicit `required: false`

* `cloudflare_dns`: empty `comment` idempotency fix

(cherry picked from commit 3c23ce4)
@felixfontein
Copy link
Collaborator

@Sergio-IME thanks for your contribution!
@russoz thanks for reviewing!

felixfontein pushed a commit that referenced this pull request Nov 25, 2024
… for `comment` and `tags` (#9184)

`cloudflare_dns`: add support for `comment` and `tags` (#9132)

* `cloudflare_dns`: add support for `comment` and `tags`

* `cloudflare_dns`: add return values for `comment`/`tags` fields

* `cloudflare_dns`: fix return values samples

* `cloudflare_dns`: changelog fragment formatting

* `cloudflare_dns`: add missing `version_added`

* `cloudflare_dns`: remove explicit `required: false`

* `cloudflare_dns`: empty `comment` idempotency fix

(cherry picked from commit 3c23ce4)

Co-authored-by: Sergio <[email protected]>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…ctions#9132)

* `cloudflare_dns`: add support for `comment` and `tags`

* `cloudflare_dns`: add return values for `comment`/`tags` fields

* `cloudflare_dns`: fix return values samples

* `cloudflare_dns`: changelog fragment formatting

* `cloudflare_dns`: add missing `version_added`

* `cloudflare_dns`: remove explicit `required: false`

* `cloudflare_dns`: empty `comment` idempotency fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-10 Automatically create a backport for the stable-10 branch feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants