Skip to content
Snippets Groups Projects
Commit ebadd0e2 authored by jurgenhaas's avatar jurgenhaas
Browse files

Support custom items for blacklists

parent ad731207
No related branches found
No related tags found
No related merge requests found
---
# file: roles/haproxy/tasks/blacklists.yml
- name: "Update blacklists"
template:
src: '{{ item }}'
dest: '/etc/haproxy/{{ item }}'
owner: 'root'
group: 'root'
mode: '644'
with_items:
- 'blacklist.ip'
- 'blacklist.referer'
- 'blacklist.agent'
notify: "Check HAProxy Config"
......@@ -72,19 +72,6 @@
with_items: '{{ groups.webserver|default([]) }}'
changed_when: false
- name: "Update blacklists"
template:
src='{{ item }}'
dest='/etc/haproxy/{{ item }}'
owner='root'
group='root'
mode='644'
with_items:
- 'blacklist.ip'
- 'blacklist.referer'
- 'blacklist.agent'
notify: "Check HAProxy Config"
- name: "Update private ips"
template:
src='privatelist.ip.jinja2'
......
......@@ -9,7 +9,12 @@
- import_tasks: install.yml
- import_tasks: configure.yml
tags: 'Config'
tags:
- 'Config'
- import_tasks: blacklists.yml
tags:
- 'Config'
- 'Blacklists'
when: '"haproxy" not in excluded_roles'
......
{% if ansible_local is defined and ansible_local.blacklist is defined %}
{% for line in ansible_local.blacklist.agent|default([]) %}
{{line}}
{% endfor %}
{% endif %}
{% for line in proxy_blacklist.agent|default([]) %}
{{line}}
{% endfor %}
{% if ansible_local is defined and ansible_local.blacklist is defined %}
{% for line in ansible_local.blacklist.ip|default([]) %}
{{line}}
{% endfor %}
{% endif %}
{% for line in proxy_blacklist.ip|default([]) %}
{{line}}
{% endfor %}
{% if ansible_local is defined and ansible_local.blacklist is defined %}
{% for line in ansible_local.blacklist.referer|default([]) %}
{{line}}
{% endfor %}
{% endif %}
{% for line in proxy_blacklist.referer|default([]) %}
{{line}}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment