Skip to content

Commit

Permalink
fix: cast sbd option value to string
Browse files Browse the repository at this point in the history
Cause: Some versions of Ansible/Jinja have a problem with evaluating
a non-string value as a string inside of a macro.

Consequence: Ansible will give an error that a templated value
is not a string.

Fix: Cast the value to a string.

Result: Ansible correctly templates the variable with no errors.

Signed-off-by: Rich Megginson <[email protected]>
  • Loading branch information
richm committed Nov 3, 2023
1 parent 5dd3adf commit 5fcd781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/sbd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% macro option(ansible_name, default_value) -%}
{%- for option in options if option.name == ansible_name -%}
{{ option.value }}
{{ option.value | string }}
{%- else -%}
{{ default_value }}
{%- endfor -%}
Expand Down

0 comments on commit 5fcd781

Please sign in to comment.