StackStorm / ansible-st2

Ansible Roles and Playbooks to deploy StackStorm
https://galaxy.ansible.com/StackStorm/stackstorm/
Apache License 2.0
100 stars 75 forks source link

Explicit mark variable as bool #244

Closed LindsayHill closed 5 years ago

LindsayHill commented 5 years ago

Resolve a couple more deprecation warnings, e.g.

TASK [StackStorm.st2 : user | Disable requiretty] *************************************************************************************************************************
[DEPRECATION WARNING]: evaluating st2_system_user_in_sudoers as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the
future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
arm4b commented 5 years ago

I also found this Warning/behavior strange from Ansible side. At least warning shouldn't show if var is already bool.

arm4b commented 5 years ago

Here we go, it's already pretty hot discussed: https://github.com/ansible/ansible/issues/53428#issuecomment-497380458 and improved a couple of days ago: https://github.com/ansible/ansible/pull/57190

We'll probably see improvements in next Ansible version. Or hopefully they'll backport it to latest stable.

LindsayHill commented 5 years ago

Yeah, it's pretty annoying behavior for me where that variable is a bool. I understand the warning in situations where it's being evaluated as truthy, but for these cases it's pretty petty.