How to create a firewall rule using Ansible Playbook

0 votes

Hi Guys,

I am trying to create a firewall rule for httpd webserver using Ansible Playbook. So that it will allow everyone to connect to Webserver. But how can I create a firewall rule?

Sep 2, 2020 in Ansible by akhtar
• 38,180 points
934 views

1 answer to this question.

0 votes

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
answered Sep 2, 2020 by MD
• 95,220 points

Related Questions In Ansible

0 votes
1 answer

How to create a security group in AWS using Ansible-Playbook?

Hi@akhtar, You can use the ec2_group module in ...READ MORE

answered Aug 13, 2020 in Ansible by MD
• 95,220 points
970 views
0 votes
2 answers

How to create a directory in remote nodes using Ansible-Playbook?

You can read install and setup apache ...READ MORE

answered Aug 23, 2020 in Ansible by anonymous
• 160 points
544 views
0 votes
1 answer

How to create a user using Ansible Playbook?

Hi@akhtar, You can use the user module in ...READ MORE

answered Sep 1, 2020 in Ansible by MD
• 95,220 points
402 views
0 votes
1 answer

How to create a group using Ansible Playbook?

Hi@akhtar, You can find one module named group ...READ MORE

answered Sep 1, 2020 in Ansible by MD
• 95,220 points
318 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,135 views
+2 votes
1 answer
0 votes
1 answer

How to create a docker container using Ansible playbook?

Hi@akhtar, You can use the docker_container module in ...READ MORE

answered Aug 7, 2020 in Ansible by MD
• 95,220 points
2,214 views
0 votes
1 answer

How to create a key pair on AWS using Ansible-Playbook?

Hi@akhtar, You can find the ec2_key module in ...READ MORE

answered Aug 12, 2020 in Ansible by MD
• 95,220 points
247 views