make it worjk on debian 12, add firewall
This commit is contained in:
@@ -1,24 +1,38 @@
|
|||||||
---
|
---
|
||||||
# tasks file for rspamd
|
# tasks file for rspamd
|
||||||
- name: configure repo
|
- name: configure repo
|
||||||
get_url:
|
when: ansible_os_family == 'RedHat'
|
||||||
|
block:
|
||||||
|
- ansible.builtin.get_url:
|
||||||
url: https://rspamd.com/rpm-stable/centos-7/rspamd.repo
|
url: https://rspamd.com/rpm-stable/centos-7/rspamd.repo
|
||||||
dest: /etc/yum.repos.d/rspamd.repo
|
dest: /etc/yum.repos.d/rspamd.repo
|
||||||
|
|
||||||
- name: get repo gpg key
|
- ansible.builtin.rpm_key:
|
||||||
rpm_key:
|
|
||||||
key: https://rspamd.com/rpm-stable/gpg.key
|
key: https://rspamd.com/rpm-stable/gpg.key
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: install rspamd
|
- name: install rspamd
|
||||||
yum:
|
ansible.builtin.package:
|
||||||
state: present
|
state: present
|
||||||
name:
|
name: rspamd
|
||||||
- rspamd
|
|
||||||
- redis
|
- name: open firewall port
|
||||||
|
when: use_ufw
|
||||||
|
community.general.ufw:
|
||||||
|
proto: tcp
|
||||||
|
port: "11332"
|
||||||
|
src: "{{ item.ip}}"
|
||||||
|
comment: "{{ item.comment }}"
|
||||||
|
rule: allow
|
||||||
|
loop:
|
||||||
|
- { ip: 163.172.96.97, comment: submarine }
|
||||||
|
- { ip: 80.67.185.27, comment: altc01 }
|
||||||
|
- { ip: 51.15.130.230, comment: mutine }
|
||||||
|
- { ip: 51.15.99.153, comment: celestine }
|
||||||
|
- { ip: 51.15.253.78, comment: cosine }
|
||||||
|
|
||||||
- name: ensure rspamd listen everywhere
|
- name: ensure rspamd listen everywhere
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
create: true
|
create: true
|
||||||
path: /etc/rspamd/local.d/proxy-normal.inc
|
path: /etc/rspamd/local.d/proxy-normal.inc
|
||||||
regex: "^bind_socket = localhost:11332"
|
regex: "^bind_socket = localhost:11332"
|
||||||
@@ -26,19 +40,14 @@
|
|||||||
notify: restart rspamd
|
notify: restart rspamd
|
||||||
|
|
||||||
- name: binding rspamd to redis
|
- name: binding rspamd to redis
|
||||||
template:
|
ansible.builtin.lineinfile:
|
||||||
dest: /etc/rspamd/local.d/redis.conf
|
create: true
|
||||||
content: |
|
path: /etc/rspamd/local.d/redis.conf
|
||||||
read_servers = "127.0.0.1,10.0.0.1";
|
line: 'servers: "127.0.0.1"'
|
||||||
write_servers = "127.0.0.1";
|
|
||||||
notify: restart rspamd
|
notify: restart rspamd
|
||||||
|
|
||||||
- name: start service
|
- name: start service
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ item }}"
|
name: rspamd
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
loop:
|
|
||||||
- redis
|
|
||||||
- rspamd
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user