apache/nginx: IP adresses can also be removed
This commit is contained in:
parent
b776fc3da2
commit
24ddc78a23
|
@ -13,18 +13,6 @@
|
||||||
|
|
||||||
- name: Load IP whitelist task
|
- name: Load IP whitelist task
|
||||||
include: ip_whitelist.yml
|
include: ip_whitelist.yml
|
||||||
tags:
|
|
||||||
- apache
|
|
||||||
|
|
||||||
- name: remove IP addresses from private IP whitelist
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/apache2/ipaddr_whitelist.conf
|
|
||||||
line: "Require ip {{ item }}"
|
|
||||||
state: absent
|
|
||||||
with_items: "{{ apache_ipaddr_whitelist_absent }}"
|
|
||||||
notify: reload apache
|
|
||||||
tags:
|
|
||||||
- apache
|
|
||||||
|
|
||||||
- name: include private IP whitelist for server-status
|
- name: include private IP whitelist for server-status
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: add IP addresses to private IP whitelist
|
- name: add IP addresses to private IP whitelist
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/apache2/ipaddr_whitelist.conf
|
dest: /etc/apache2/ipaddr_whitelist.conf
|
||||||
|
@ -7,4 +8,16 @@
|
||||||
with_items: "{{ apache_ipaddr_whitelist_present }}"
|
with_items: "{{ apache_ipaddr_whitelist_present }}"
|
||||||
notify: reload apache
|
notify: reload apache
|
||||||
tags:
|
tags:
|
||||||
- apache
|
- apache
|
||||||
|
- ips
|
||||||
|
|
||||||
|
- name: remove IP addresses from private IP whitelist
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/apache2/ipaddr_whitelist.conf
|
||||||
|
line: "Require ip {{ item }}"
|
||||||
|
state: absent
|
||||||
|
with_items: "{{ apache_ipaddr_whitelist_absent }}"
|
||||||
|
notify: reload apache
|
||||||
|
tags:
|
||||||
|
- apache
|
||||||
|
- ips
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: add IP addresses to private IP whitelist
|
- name: add IP addresses to private IP whitelist
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/nginx/snippets/ipaddr_whitelist
|
dest: /etc/nginx/snippets/ipaddr_whitelist
|
||||||
|
@ -6,5 +7,17 @@
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_ipaddr_whitelist_present }}"
|
with_items: "{{ nginx_ipaddr_whitelist_present }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
tags
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
|
- ips
|
||||||
|
|
||||||
|
- name: remove IP addresses from private IP whitelist
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/nginx/snippets/ipaddr_whitelist
|
||||||
|
line: "allow {{ item }};"
|
||||||
|
state: absent
|
||||||
|
with_items: "{{ nginx_ipaddr_whitelist_absent }}"
|
||||||
|
notify: reload nginx
|
||||||
|
tags:
|
||||||
|
- nginx
|
||||||
|
- ips
|
||||||
|
|
|
@ -50,23 +50,9 @@
|
||||||
tags:
|
tags:
|
||||||
- nginx
|
- nginx
|
||||||
- ips
|
- ips
|
||||||
|
|
||||||
- name: Include IP address whitelist task
|
- name: Include IP address whitelist task
|
||||||
include: ip_whitelist.yml
|
include: ip_whitelist.yml
|
||||||
tags:
|
|
||||||
- nginx
|
|
||||||
- ips
|
|
||||||
|
|
||||||
- name: remove IP addresses from private IP whitelist
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/nginx/snippets/ipaddr_whitelist
|
|
||||||
line: "allow {{ item }};"
|
|
||||||
state: absent
|
|
||||||
with_items: "{{ nginx_ipaddr_whitelist_absent }}"
|
|
||||||
notify: reload nginx
|
|
||||||
tags:
|
|
||||||
- nginx
|
|
||||||
- ips
|
|
||||||
|
|
||||||
- name: Copy private_htpasswd
|
- name: Copy private_htpasswd
|
||||||
copy:
|
copy:
|
||||||
|
|
Loading…
Reference in a new issue