coursework/ansible/roles/site_setup/tasks/configure_firewall.yml

28 lines
580 B
YAML
Raw Normal View History

2024-11-11 10:48:06 +00:00
- name: Start and enable firewalld
service:
name: firewalld
state: started
enabled: true
tags: firewall
- name: Open port 80 for HTTP
ansible.builtin.firewalld:
port: 80/tcp
permanent: true
state: enabled
immediate: yes
tags: firewall
- name: Open port 443 for HTTPS
ansible.builtin.firewalld:
port: 443/tcp
permanent: true
state: enabled
immediate: yes
tags: firewall
- name: Reload firewalld to apply changes
ansible.builtin.service:
name: firewalld
state: reloaded
2024-11-11 20:16:26 +00:00
tags: firewall