ansible-role-nginx
ansible-role-nginx copied to clipboard
Warning, Duplicate When Key
[WARNING]: While constructing a mapping from /run/media/jbecker/archive/Projects/playbook-uniwear/required-roles/nginx/tasks/configuration.yml, line 62, column 3, found a duplicate dict key (when).
Using last defined value only.
When executing a playbook which includes the nginx role, this warning message was displayed. I believe the double when: could be replaced with a list.
Introduced in this commit: https://github.com/jdauphant/ansible-role-nginx/commit/68633437e49f0e740f4dcae7754e025755ab89c2
This commit also introduce by default nginx to load the mod-http-geoip
module.
It would be better to not load modules by default. Let people decide what have to be loaded
cc @q2digger
@techzilla @rlex Thanks for the report. If some of you or @q2digger can fix, it will be very nice ;)
@gaelL No worries, it's the documentation, geoip isn't load by default ;)
There is more to it than just fixing "when"
After some digging i think that
(only for RHEL & CentOS).
Is wrong.
Ubuntu, nginx.org repo:
nginx-module-geoip - nginx GeoIP dynamic modules
nginx-module-geoip-dbg - debug symbols for the nginx-module-geoip
nginx-module-image-filter - nginx image filter dynamic module
nginx-module-image-filter-dbg - debug symbols for the nginx-module-image-filter
nginx-module-njs - nginx njs dynamic modules
nginx-module-njs-dbg - debug symbols for the nginx-module-njs
nginx-module-perl - nginx Perl dynamic module
nginx-module-perl-dbg - debug symbols for the nginx-module-perl
nginx-module-xslt - nginx xslt dynamic module
nginx-module-xslt-dbg - debug symbols for the nginx-module-xslt
nginx-nr-agent - New Relic agent for NGINX and NGINX Plus
Debian/ubuntu official repos also have modules (and they are pretty much the same): https://packages.debian.org/search?keywords=libnginx&searchon=names&suite=stable§ion=all https://packages.ubuntu.com/search?keywords=libnginx&searchon=names&suite=bionic§ion=all
So we have 3 versions of path difference between rhel/debian (maybe load it in vars/{debian,redhat}?) RHEL uses (both mainline and official repos? Can someone with centos/any other rhel confirm?)
/urs/share/nginx/modules
(Worth mentioning that current path specified in task will not work because of "urs" instead of "usr")
Debian:
/usr/share/nginx/modules-available/
And debian from nginx.org repo:
/usr/lib/nginx/modules
This one is tricky - it only installs .so files without configs to enable, so we need to generate configs manually.
Any ideas?
ahh ok, I can see the duplicate when statements which are generating this warning.
I have hopefully included a fix for this in PR #235 .