Skip to content

domain_record TTLs are not rounded to closest valid values when diffing#755

Open
mgwoj wants to merge 4 commits intolinode:devfrom
mgwoj:feature/TPT-3591-ansible-domain_record-ttls-are-not-rounded-to-closest-valid-values-when-diffing
Open

domain_record TTLs are not rounded to closest valid values when diffing#755
mgwoj wants to merge 4 commits intolinode:devfrom
mgwoj:feature/TPT-3591-ansible-domain_record-ttls-are-not-rounded-to-closest-valid-values-when-diffing

Conversation

@mgwoj
Copy link

@mgwoj mgwoj commented Feb 9, 2026

📝 Description

ttl_sec from domain_record is accepting any integer value, but API is rounding it to nearest accepted value, causing diff on update. As a solution we also perform this rounding locally.

✔️ How to Test

ansible-test integration domain_record

@mgwoj mgwoj requested a review from a team as a code owner February 9, 2026 14:38
@mgwoj mgwoj requested review from dawiddzhafarov and jriddle-linode and removed request for a team February 9, 2026 14:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes idempotency issues in the linode.cloud.domain_record module when users provide a ttl_sec that the Linode API rounds to the nearest accepted TTL value, which previously caused perpetual diffs on subsequent runs.

Changes:

  • Added local TTL normalization to the nearest valid TTL value during create/update of domain records.
  • Expanded integration coverage to validate TTL rounding behavior (including min/max bounds) and idempotency with invalid TTL inputs.
  • Updated module/docs parameter descriptions to document valid TTL values and rounding behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
plugins/modules/domain_record.py Normalizes ttl_sec to the nearest accepted TTL value before create/update to prevent spurious diffs.
tests/integration/targets/domain_record/tasks/main.yaml Adds integration assertions for TTL rounding and idempotency when an invalid TTL is provided.
docs/modules/domain_record.md Documents valid TTL values and clarifies that invalid values are rounded to the nearest valid TTL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

1 participant