coursework/ansible/roles/firewall/tasks/main.yml
2024-11-24 19:44:14 +03:00

24 lines
503 B
YAML

- name: Install firewalld
zypper:
name: firewalld
state: present
notify:
- Restart firewalld
- name: Ensure firewalld is enabled and started
systemd:
name: firewalld
enabled: yes
state: started
notify:
- Restart firewalld
- name: Open specified firewall ports
firewalld:
port: "{{ item.port }}/{{ item.protocol }}"
permanent: yes
state: enabled
immediate: yes
loop: "{{ firewall_ports }}"
notify:
- Restart firewalld