Skip to content

Replace bare ansible_date_time with ansible_facts.date_time#54

Merged
Oddly merged 1 commit intomainfrom
fix/ansible-date-time-deprecation
Mar 4, 2026
Merged

Replace bare ansible_date_time with ansible_facts.date_time#54
Oddly merged 1 commit intomainfrom
fix/ansible-date-time-deprecation

Conversation

@Oddly
Copy link
Copy Markdown
Owner

@Oddly Oddly commented Mar 1, 2026

Closes #44.

Ansible 2.20 already emits INJECT_FACTS_AS_VARS deprecation warnings for bare fact access like ansible_date_time.date, and Ansible 2.24 will remove the legacy injection entirely. Three role task files (cert_backup, cert_check_expiry, cert_expiry_warn) and two molecule converge files used the bare form. This replaces all occurrences with ansible_facts.date_time.*, matching the style already used everywhere else in the codebase.

@Oddly Oddly force-pushed the fix/ansible-date-time-deprecation branch 9 times, most recently from d5fceec to 90599a9 Compare March 4, 2026 15:09
Ansible 2.20 deprecated INJECT_FACTS_AS_VARS and 2.24 will remove it
entirely. Three role task files and two molecule converge files used the
bare ansible_date_time form which triggers deprecation warnings on every
run. Switched to the ansible_facts.date_time accessor throughout.

Closes #44
@Oddly Oddly force-pushed the fix/ansible-date-time-deprecation branch from 90599a9 to f8244b4 Compare March 4, 2026 19:06
@Oddly Oddly merged commit 7dbbaa2 into main Mar 4, 2026
30 of 32 checks passed
@Oddly Oddly deleted the fix/ansible-date-time-deprecation branch March 4, 2026 19:11
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.

Prepare for Ansible 2.24: replace bare ansible_date_time references

1 participant