geerlingguy / ansible-role-nginx

Ansible Role - Nginx

Home Page:https://galaxy.ansible.com/geerlingguy/nginx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nginx_listen_ipv6 is undefined in the vhost.js template

peterbabic opened this issue · comments

Hello,
copying the templates/vhost.j2 template and referencin it manually via

nginx-vhosts:
  - template: "{{ playbook_dir }}/templates/vhost.j2"

throws the "msg": "AnsibleUndefinedVariable: 'nginx_listen_ipv6' is undefined" error when the playbook is run.

The error is gone when adding is defined to the L5 and L19

{% if nginx_listen_ipv6 %}

{% if nginx_listen_ipv6 %}

resulting in

{% if nginx_listen_ipv6 is defined %}

following the convention throughout rest of the the template (every if block has if defined statement).

Hi,

Unless I'm mistaken, this variable was added during the merge request #125 dated April 14th.

In my opinion it's a variable you must be missing since the if condition in its simplest form tests if the variable is defined, not empty and not false.

Hello @julien-langlois,
thank you for the response. Please excuse me, I am unsure right now how to approach this, as I have been solving many other things since this one and frankly I do not really remember what was going on exactly. I will eventually get back to this and report back.

commented

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.

commented

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.