ansible-roles/evobackup-client/tasks/open_ssh_ports.yml

22 lines
661 B
YAML
Raw Normal View History

2019-08-30 20:43:52 +02:00
---
- name: Is there a Minifirewall ?
stat:
path: /etc/default/minifirewall
register: evobackup-client__minifirewall
tags:
- evobackup-client
- evobackup-client-backup-firewall
- name: Add backup SSH port in /etc/default/minifirewall
blockinfile:
dest: /etc/default/minifirewall
marker: "# {{ item.name }}"
block: |
/sbin/iptables -A INPUT -p tcp --sport {{ item.port }} --dport 1024:65535 -s {{ item.ip }} -m state --state ESTABLISHED,RELATED -j ACCEPT
with_items: "{{ evobackup-client__hosts }}"
2019-08-30 20:43:52 +02:00
when: evobackup-client__minifirewall.stat.exists
tags:
- evobackup-client
- evobackup-client-backup-firewall