mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 15:47:32 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
21
roles/sftpgo/tasks/iptables.yml
Normal file
21
roles/sftpgo/tasks/iptables.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
- name: Handle sftpgo ports in the firewall
|
||||
iptables_raw:
|
||||
name: "{{ item.name }}"
|
||||
state: "{{ (item.src_ip | length > 0) | ternary('present','absent') }}"
|
||||
rules: "-A INPUT -m state --state NEW -p tcp {{ item.port is string | ternary('--dport ' ~ item.port, '-m multiport --dports ' ~ item.port | join(',')) }} -s {{ item.src_ip | join(',') }} -j ACCEPT"
|
||||
with_items:
|
||||
- port: "{{ sftpgo_conf.sftpd.bindings.port }}"
|
||||
name: sftpgo_sftp_port
|
||||
src_ip: "{{ sftpgo_sftp_src_ip }}"
|
||||
- port: "{{ [sftpgo_conf.ftpd.bindings.port,sftpgo_conf.ftpd.passive_port_range.start ~ ':' ~ sftpgo_conf.ftpd.passive_port_range.end] }}"
|
||||
name: sftpgo_ftp_port
|
||||
src_ip: "{{ sftpgo_ftp_src_ip }}"
|
||||
- port: "{{ sftpgo_conf.webdavd.bindings.port }}"
|
||||
name: sftpgo_webdav_port
|
||||
src_ip: "{{ sftpgo_webdav_src_ip }}"
|
||||
- port: "{{ sftpgo_conf.httpd.bindings.port }}"
|
||||
name: sftpgo_http_port
|
||||
src_ip: "{{ sftpgo_http_src_ip }}"
|
||||
tags: firewall,sftpgo
|
Reference in New Issue
Block a user