Skip to content

Support nonetype trivial default - #5

Merged
slothkong merged 3 commits into
mainfrom
support-nonetype-trivial-default
Feb 13, 2026
Merged

Support nonetype trivial default#5
slothkong merged 3 commits into
mainfrom
support-nonetype-trivial-default

Conversation

@slothkong

@slothkong slothkong commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

This is done to align with the precedence set by CLI tools like Terraform/OpenTofu, where setting null (conceptual equivalent of None) is needed to avoid the complexity of dealing with trivial default for values with a complex structure (i.e. dictionaries containing sub dictionaries, lists of dictionaries, etc.)

IMPORTANT: The ansible.builtin.assert statements used for input validation must continue allowing empty string ('') as a synonym of null. This is a technical limitation of the var_prompt statements we used on Ansible Playbooks that import this Ansible Role.
To be clear , at the time of writing, when an Ansible Playbook runs var_prompt and asks for an optional input , users have the option to press enter to skip, indicating they want to set the trivial default value. If users do press enter to skip, var_prompt set the corresponding variable as a empty str, NOT as a noneType. Hence the Ansible Role needs to deal with both as if they were equivalent. The same is true for the literal string containing the word None, which is set the the Ansible Playbook if run in non-interactive mode while ommitting the variable upon running Ansible.

cc: @pacospace

@slothkong
slothkong force-pushed the support-nonetype-trivial-default branch from 72c5bd9 to cc31f2a Compare February 13, 2026 14:29
@slothkong
slothkong merged commit b7b873f into main Feb 13, 2026
2 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 13, 2026
## [1.5.2](1.5.1...1.5.2) (2026-02-13)

### Bug Fixes

* Support nonetype trivial default ([#5](#5)) ([b7b873f](b7b873f))
@slothkong
slothkong deleted the support-nonetype-trivial-default branch February 13, 2026 14:34
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