--- - name: Basic provisioning example hosts: local connection: local gather_facts: False tags: provisioning vars: keypair: MyinfraCodeKey instance_type: t2.micro image: ami-916f59f4 wait: yes group: webserver count: 1 region: us-east-2 security_group: ansible-webserver-1 tasks: - name: Create a security group local_action: module: ec2_group name: "{{ security_group }}" description: Security Group for webserver Servers region: "{{ region }}" rules: - proto: tcp from_port: 22 to_port: 22 cidr_ip: 0.0.0.0/0 - proto: tcp from_port: 80 to_port: 80 cidr_ip: 0.0.0.0/0 - proto: tcp from_port: 443 to_port: 443 cidr_ip: 0.0.0.0/0 rules_egress: - proto: all cidr_ip: 0.0.0.0/0 register: basic_firewall - name: Launch the new EC2 Instance local_action: ec2 group={{ security_group }} instance_type={{ instance_type}} image={{ image }} wait=true region={{ region }} keypair={{ keypair }} count={{count}} register: ec2 - name: Add the newly created EC2 instance(s) to the local host group (located inside the directory) local_action: lineinfile dest="/etc/ansible/hosts" regexp={{ item.public_ip }} insertafter="[webserver]" line={{ item.public_ip }} with_items: "{{ ec2.instances }}"
Hands on DevOps Coaching provided on AWS and Azure Cloud platforms. please contact devops.coaching@gmail.com for more info.
Monday, October 9, 2017
Basic provisioning example of EC2 instance using Ansible on AWS
Subscribe to:
Post Comments (Atom)
Featured Post
-
Amazon ECR uses Amazon S3 for storage to make your container images highly available and accessible, allowing you to reliably deploy new co...
-
Let us see how to connect to an EC2 instance running in AWS from your local machine. Pre-requisites: 1. Keys(for e.g., yourkey.pem) a...
-
We will learn how to automate Docker builds using Jenkins. We will use Python based application. I have already created a repo with source...
Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
ReplyDeleteSoftware testing course in chennai
Great Article Cloud Computing Projects
DeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Good informations It mayt be Helpfull for me thanks alot for sharing, Know how Development and operations will work in one platform
ReplyDeletedevops training in chennai
Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition
ReplyDeleteaws training in chennai
selenium training in chennai
python training in chennai
Very nice post with lots of information. Thanks for this updates.
ReplyDeleteui ux design course in Chennai
ui ux designer course in Chennai
ui ux course in chennai
ReactJS Training in Chennai
Web Designing Course in chennai
web designing training in chennai
Tally course in Chennai
ui ux design course in Porur
ui ux design course in Tambaram
ui ux design course in Adyar
Thanks for sharing this post with us it is a worth readweb design company in velachery
ReplyDeleteGreat blog thanks for sharing Looking for the best creative agency to fuel new brand ideas? Adhuntt Media is not just a digital marketing company in chennai. We specialize in revamping your brand identity to drive in best traffic that converts. Buckle up for a ride that is going to be filled with SEO, Social media marketing, unique Graphic & Logo design and efficient ads strike the perfect chord! Join the Adhuntt Media adventure right at Adhuntt Media.
ReplyDeletedigital marketing company in chennai
Nice blog thanks for sharing Try out different styles and bring your backyard back to life with the best garden service in Chennai - Karuna Nursery Gardens. Right from landscaping, terrace gardening and corporate services and renting plants, we do it all.
ReplyDeleteplant nursery in chennai
Excellent blog thanks for sharing Pixies beauty Shop is the best place to buy cosmetics in Chennai. With thousands of premium imported brands to choose from, you’ll never run out of lipstick again. And don’t forget about the best offers and value they provide.
ReplyDeleteCosmetics Shop in Chennai
good information.....!
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it
brunei darussalam web hosting
costa rica web hosting
costa rica web hosting
hong kong web hosting
jordan web hosting
turkey web hosting
gibraltar web hosting
ReplyDeleteVery useful blog thanks for sharing IndPac India the German technology Packaging and sealing machines in India is the leading manufacturer and exporter of Packing Machines in India.
Your blog is so impressive to us. I appreciate the way of delivering the concepts.
ReplyDeletetechnical and non technical skills
latest artificial intelligence
ccna certified jobs
short courses
cyber security interview questions for experienced
java interview questions and answers for experienced
Spoken English Classes in Chennai
ReplyDeleteGerman Classes in Chennai
Spoken Hindi Classes in Chennai
French Classes in Chennai