Guys am getting an error while running the firewall module --- - hosts: web b . . .

Thandar Suresh:
Guys am getting an error while running the firewall module


  • hosts: web
    become: yes
    tasks:
    • firewalld:
      port: 3306/tcp
      service: mysqld
      source: 192.168.100.10
      zone: public
      state: enabled
      permanent: yes
      immediate: yes

Error:
TASK [firewalld] *******************************************************************************
fatal: [web1]: FAILED! => {“changed”: false, “msg”: “can only operate on port, service, rich_rule, or interface at once”}
fatal: [web2]: FAILED! => {“changed”: false, “msg”: “can only operate on port, service, rich_rule, or interface at once”}

Al West:
As the error says only provide the service or the port - not both. I would pick service

Thandar Suresh:
ok will try it out & let you know

Thandar Suresh:
Thanks it worked out