geerlingguy / ansible-role-varnish

Ansible Role - Varnish HTTP accelerator
https://galaxy.ansible.com/geerlingguy/varnish/
MIT License
80 stars 88 forks source link

"Ensure Varnish VMODs are installed" emits deprecation notice #116

Closed Bilge closed 4 months ago

Bilge commented 10 months ago
TASK [geerlingguy.varnish : Ensure Varnish VMODs are installed.] *******************************************************
[DEPRECATION WARNING]: evaluating u'varnish_modules_package_name' 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.

This seems to be caused by https://github.com/geerlingguy/ansible-role-varnish/blob/122aa0f8a386d98f6d2e66406ac2f4db1d90e34e/tasks/setup-Debian.yml#L31

If one actually sets varnish_modules_package_name: varnish-modules, as is presumably the intended use of this feature, not only does it emit the deprecation notice but it also causes a fatal error:

fatal: [REDACTED]: FAILED! => {"msg": "The conditional check 'varnish_modules_package_name' failed. The error was: error while evaluating conditional (varnish_modules_package_name): 'varnish' is undefined\n\nThe error appears to be in '~/.ansible/roles/geerlingguy.varnish/tasks/setup-Debian.yml': line 27, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Ensure Varnish VMODs are installed.\n ^ here\n"}

adepretis commented 10 months ago

@Bilge unfortunately I can not reproduce this with Ansible 2.14 and I had it running with Ansible > 2.10 for quite some time.

I made a small change that might help though - can you try it please?

github-actions[bot] commented 6 months ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] commented 4 months ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.