diff --git a/srv/salt/webserver/init.sls b/srv/salt/webserver/init.sls index 61a6545..6bdc6b7 100644 --- a/srv/salt/webserver/init.sls +++ b/srv/salt/webserver/init.sls @@ -13,22 +13,13 @@ install_html_file: - require: - pkg: {{ pillar['pkgs']['apache'] }} -configure_firewall_service: +configure_firewall: 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: - - webserver + - http + - https diff --git a/srv/salt/webserver/uninstall.sls b/srv/salt/webserver/uninstall.sls index a28ac3b..1ac2ddd 100644 --- a/srv/salt/webserver/uninstall.sls +++ b/srv/salt/webserver/uninstall.sls @@ -6,11 +6,15 @@ remove_html_file: file.absent: - name: /var/www/html/index.html -unconfigure_firewall: +unconfigure_firewall_http: module.run: - firewalld.remove_service: - - service: webserver + - service: http + - zone: public + +unconfigure_firewall_https: + module.run: + - firewalld.remove_service: + - service: https - zone: public - - firewalld.delete_service: - - name: webserver