mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-09 21:23:29 +01:00
Ensure values are cast to correct type
https://github.com/willshersystems/ansible-sshd/issues/188 This shouldn't be necessary, but there seems no way to guarantee using a version of Jinja which doesn't have this problem. In addition - it is not good practice to compare values to `true` or `false` - instead, just ensure the value is a `bool` type and evaluate in a boolean context.
This commit is contained in:
parent
9766d9097a
commit
67d2339f03
3 changed files with 5 additions and 5 deletions
|
@ -7,10 +7,10 @@
|
|||
{% elif value is sameas false %}
|
||||
{{ key }} no
|
||||
{% elif value is string or value is number %}
|
||||
{{ key }} {{ value }}
|
||||
{{ key }} {{ value | string }}
|
||||
{% else %}
|
||||
{% for i in value %}
|
||||
{{ key }} {{ i }}
|
||||
{{ key }} {{ i | string }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
{% elif value is sameas false %}
|
||||
{{ key }} no
|
||||
{% elif value is string or value is number %}
|
||||
{{ key }} {{ value }}
|
||||
{{ key }} {{ value | string }}
|
||||
{% else %}
|
||||
{% for i in value %}
|
||||
{{ key }} {{ i }}
|
||||
{{ key }} {{ i | string }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ ansible_managed | comment }}
|
||||
{% if __sshd_sysconfig_supports_crypto_policy %}
|
||||
{% if sshd_sysconfig_override_crypto_policy == true %}
|
||||
{% if sshd_sysconfig_override_crypto_policy | bool %}
|
||||
CRYPTO_POLICY=
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue