configure/unconfigure firewall

This commit is contained in:
John Bowdre 2023-03-28 09:56:37 -05:00
parent 62bd4a6f35
commit 6a83a4a393
2 changed files with 21 additions and 3 deletions

View file

@ -13,13 +13,22 @@ install_html_file:
- require:
- pkg: {{ pillar['pkgs']['apache'] }}
configure_firewall:
configure_firewall_service:
pkg.installed:
- name: firewalld
firewalld.service:
- require:
- pkg: firewalld
- name: webserver
- ports:
- 80/tcp
- 443/tcp
configure_firewall_zone:
firewalld.present:
- require:
- pkg: firewalld
- firewalld: webserver
- name: public
- services:
- http
- https
- webserver

View file

@ -5,3 +5,12 @@ uninstall_apache:
remove_html_file:
file.absent:
- name: /var/www/html/index.html
unconfigure_firewall:
module.run:
- firewalld.remove_service:
- service: webserver
- zone: public
- firewalld.delete_service:
- name: webserver