ansible-roles/evobackup-client/tasks/open_ssh_ports.yml
Patrick Marchand c773c901f2 Fix to evobackup-client variable names
Somehow, an extra _ managed to slide itself in a few places.
2019-09-03 09:51:46 -04:00

32 lines
971 B
YAML

---
- name: Is there a Minifirewall ?
stat:
path: /etc/default/minifirewall
register: evobackup-client__minifirewall
tags:
- evobackup-client
- evobackup-client-backup-firewall
- name: backup ssh port
blockinfile:
dest: /etc/default/minifirewall
marker: "# evobackup ssh port"
block: "evobackup_port={{ evobackup-client__ssh_port }}"
when: evobackup-client__minifirewall.stat.exists
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 {{ evobackup-client__ssh_port }} --dport 1024:65535 -s {{ item.ip }} -m state --state ESTABLISHED,RELATED -j ACCEPT
with_items: "{{ evobackup-client__hosts }}"
when: evobackup-client__minifirewall.stat.exists
tags:
- evobackup-client
- evobackup-client-backup-firewall