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

0 votes

Hi Guys,

I am trying to connect my AWS console from my Ansible-Playbook. I have a requirement where I have to create a security group in AWS from my playbook. How can I do that?

Aug 13 in Ansible by akhtar
• 25,030 points
129 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the ec2_group module in your playbook. This module has the capability to create a security group in AWS. One example is given below for your reference.

  ec2_group:
    name: "{{ name }}"
    description: sg with rule descriptions
    vpc_id: vpc-xxxxxxxx
    profile: "{{ aws_profile }}"
    region: us-east-1
    rules:
      - proto: tcp
        ports:
        - 80
        cidr_ip: 0.0.0.0/0
        rule_desc: allow all on port 80
answered Aug 13 by MD
• 56,480 points

Related Questions In Ansible

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 in Ansible by MD
• 56,480 points
31 views
0 votes
1 answer

How to create a group of Managed Nodes in Ansible?

Hi@akhtar, You can use tags in your inventory ...READ MORE

answered Aug 1 in Ansible by MD
• 56,480 points
42 views
0 votes
1 answer

How to overwrite the content of a file in remote systems using Ansible playbook?

Hi@akhtar, You can find one argument in the ...READ MORE

answered Aug 2 in Ansible by MD
• 56,480 points
155 views
0 votes
1 answer

How to create a variable in Ansible Playbook?

Hi@akhtar, Variable in playbooks are very similar to using variables in ...READ MORE

answered Aug 2 in Ansible by MD
• 56,480 points
54 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
677 views
+2 votes
1 answer
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 in Ansible by MD
• 56,480 points
47 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 in Ansible by anonymous
• 160 points
58 views