Forked from carlessanagustin/ec2_group_project.yml
Last active
April 10, 2018 15:25
-
-
Save goern/408f96f91a2b32c5018936803b528398 to your computer and use it in GitHub Desktop.
ANSIBLE: Change AWS EC2 Security Group configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ansible-playbook -v | |
--- | |
- hosts: apache0 | |
vars: | |
rule_list: | |
- { proto: icmp, type: 3, code: 4, src_cidr_ip: 0.0.0.0/0 } | |
ec2_group_region: 'us-east-2' | |
ec2_group_vpc: 'vpc-295720575' | |
ec2_group_description: 'change for AI Ops Recommendation by Red Hat Insights' | |
ec2_group_name: security_group_name | |
vars_files: | |
- vars/aws_config.yml | |
tasks: | |
- name: Change security group | |
ec2_group: | |
name: '{{ ec2_group_name }}' | |
description: '{{ ec2_group_description }}' | |
vpc_id: '{{ ec2_group_vpc }}' | |
aws_access_key: '{{ access_key }}' | |
aws_secret_key: '{{ secret_key }}' | |
region: '{{ ec2_group_region }}' | |
rules: '{{ rule_list }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment