change how firewall is configured/unconfigured

This commit is contained in:
John Bowdre 2023-03-28 10:03:39 -05:00
parent 6a83a4a393
commit 8dd18fab3d
2 changed files with 11 additions and 16 deletions

View file

@ -13,22 +13,13 @@ install_html_file:
- require: - require:
- pkg: {{ pillar['pkgs']['apache'] }} - pkg: {{ pillar['pkgs']['apache'] }}
configure_firewall_service: configure_firewall:
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:
- webserver - http
- https

View file

@ -6,11 +6,15 @@ remove_html_file:
file.absent: file.absent:
- name: /var/www/html/index.html - name: /var/www/html/index.html
unconfigure_firewall: unconfigure_firewall_http:
module.run: module.run:
- firewalld.remove_service: - firewalld.remove_service:
- service: webserver - service: http
- zone: public
unconfigure_firewall_https:
module.run:
- firewalld.remove_service:
- service: https
- zone: public - zone: public
- firewalld.delete_service:
- name: webserver