Hi@akhtar,
Ansible has a module named firewalld to create a rule in your system. This module allows for the addition or deletion of services and ports either TCP or UDP in either running or permanent firewalld rules. You can see the below example.
- firewalld:
port: 80/tcp
permanent: true
state: enabled