mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-06 16:46:54 +02:00
Update to 2022-07-21 01:00
This commit is contained in:
15
roles/nomad/tasks/iptables.yml
Normal file
15
roles/nomad/tasks/iptables.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Handle nomad ports in the firewall
|
||||
iptables_raw:
|
||||
name: nomad_port_{{ item }}
|
||||
state: "{{ (('tcp' in nomad_services[item].proto or 'udp' in nomad_services[item].proto) and nomad_services[item].src_ip | length > 0) | ternary('present', 'absent') }}"
|
||||
rules: |
|
||||
{% if 'tcp' in nomad_services[item].proto %}
|
||||
-A INPUT -m state --state NEW -p tcp --dport {{ nomad_services[item].port }} -j ACCEPT
|
||||
{% endif %}
|
||||
{% if 'udp' in nomad_services[item].proto %}
|
||||
-A INPUT -m state --state NEW -p udp --dport {{ nomad_services[item].port }} -j ACCEPT
|
||||
{% endif %}
|
||||
loop: "{{ nomad_services.keys() | list }}"
|
||||
tags: firewall,nomad
|
Reference in New Issue
Block a user