memiah/ansible-role-firewalld

Roemove ports

Opened this issue · 1 comments

Hi and good work :-)
I've a question regarding this ansible role. Is it possible to remove firewalld configurations.
Eg:
I run the role and deploy some services:

firewalld_services:
  http:
    zone: public
    state: enabled
    permanant: true
  https:
    state: enabled

Next run I change it tofirewalld_services:

  http:
    zone: public
    state: enabled
    permanant: true

still the https are showed when run firewall-cmd --list-all

Cheers
Fredrik

Hi @flysen - The quick answer would be set enabled to false and leave the service in the list.

firewalld_services:
  http:
    zone: public
    state: enabled
    permanant: true
  https:
    state: disabled

The better option could be to adjust the gather a list of the service and disable any that are not listed. This would require a few updates to the role.