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: - require:
- pkg: {{ pillar['pkgs']['apache'] }} - pkg: {{ pillar['pkgs']['apache'] }}
configure_firewall: configure_firewall_service:
pkg.installed: pkg.installed:
- name: firewalld - name: firewalld
firewalld.service:
- require:
- pkg: firewalld
- name: webserver
- ports:
- 80/tcp
- 443/tcp
configure_firewall_zone:
firewalld.present: firewalld.present:
- require: - require:
- pkg: firewalld - pkg: firewalld
- firewalld: webserver
- name: public - name: public
- services: - services:
- http - webserver
- https

View file

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