diff --git a/app/scripts/ansible/roles/waf_nginx/tasks/main.yml b/app/scripts/ansible/roles/waf_nginx/tasks/main.yml index 4fad3aa2..c0b162c0 100644 --- a/app/scripts/ansible/roles/waf_nginx/tasks/main.yml +++ b/app/scripts/ansible/roles/waf_nginx/tasks/main.yml @@ -132,6 +132,12 @@ command: "chdir=/tmp/nginx_src/nginx-{{ nginx_version.stderr.split('/')[1] }} cp objs/ngx_http_modsecurity_module.so /usr/lib/nginx/modules/" when: ansible_facts['os_family'] == 'Debian' or ansible_facts['os_family'] == 'Ubuntu' + - name: Create modules directory + become: true + file: + path: /usr/share/nginx/modules/ + state: directory + - name: Enable module for Centos become: true shell: echo 'load_module "modules/ngx_http_modsecurity_module.so";' > /usr/share/nginx/modules/mod-waf-connector.conf diff --git a/app/templates/waf.html b/app/templates/waf.html index 9ec6a489..d375b7a9 100644 --- a/app/templates/waf.html +++ b/app/templates/waf.html @@ -134,15 +134,19 @@ $("#secIntervals").css("display", "none"); var ip = [] var hostnamea = [] - {% for s in servers_all %} - {% if s.15|int() == 1 %} + {%- for s in servers_all %} + {% if service == 'haproxy '%} + {% set service_in_table = s.15 %} + {% else %} + {% set service_in_table = s.14 %} + {% endif %} + {% if service_in_table|int() == 1 %} ip.push("{{ s[2] }}"); var host = "{{s[2]}}"; host = host.replace(/\./g, '\\.'); hostnamea.push(host); {% endif %} {% endfor %} - {% if servers_all|length == 0 %} {% include 'include/getstarted.html' %}