46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
---
|
|
- name: Check if modsecurity directory exists
|
|
ansible.builtin.stat:
|
|
path: /etc/modsecurity
|
|
register: modsec_directory
|
|
|
|
- name: End play for host if modsecurity is not exists
|
|
ansible.builtin.meta: end_host
|
|
when: not modsec_directory.stat.exists
|
|
|
|
- name: Deploy modsecurity.conf
|
|
ansible.builtin.template:
|
|
src: modsecurity.conf.j2
|
|
dest: /etc/modsecurity/modsecurity.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Reload apache2
|
|
|
|
- name: Deploy owasp-crs.conf
|
|
ansible.builtin.copy:
|
|
src: modsecurity/owasp-crs.conf
|
|
dest: /etc/modsecurity/owasp-crs.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Reload apache2
|
|
|
|
- name: Deploy crs/crs-setup.conf
|
|
ansible.builtin.copy:
|
|
src: modsecurity/crs-setup.conf
|
|
dest: /etc/modsecurity/crs-git/crs-setup.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Reload apache2
|
|
|
|
- name: Deploy crs/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
|
|
ansible.builtin.copy:
|
|
src: modsecurity/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
|
|
dest: /etc/modsecurity/crs-git/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
notify: Reload apache2
|