--- - 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)
-
Let's learn how to connect to an EC2 instance running in AWS from your local machine. Your local machine can be Windows laptop or MacBoo...
-
Amazon Elastic Container Registry (ECR) is a fully managed container registry service provided by Amazon Web Services (AWS). It allows user...
-
We get these questions a lot from the teams we are coaching at my customer's work place How to create microservices? How to break...
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
Thanks for sharing this post with us it is a worth readweb design company in velachery
ReplyDeleteYour 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
I am glad to discover this post Very valuable for me. Join our Online speaking English language class in Bahrain and embark on a journey towards fluency, confidence, and success.
ReplyDeleteBook a free demo today. Best english tutoring in bahrain
Nice Blog!
ReplyDeleteIf you're looking to advance your career with industry-relevant skills, Jeevi Academy in Chennai offers a variety of top-tier courses in tech and marketing domains.
🔹 Digital Marketing: Start with the Best Digital Marketing Course in Chennai — learn brand building, social media strategy, SEO, and lead generation to become job-ready.
🔹 UI/UX Design: Explore the Best UI UX Course in Chennai and master tools like Figma and Adobe XD. Become a skilled UI UX Designer.
🔹 Cloud Computing: Hands-on training with AWS, Azure, and Google Cloud awaits in the Best Cloud Computing Course in Chennai — ideal for future cloud engineers.
🔹 DevOps: Get practical experience with Docker, Kubernetes, Jenkins, and more in the Best DevOps Course in Chennai.
🔹 Full Stack Development: Become a full-stack pro with the Best Full Stack Developer Course in Chennai, covering HTML, CSS, JavaScript, React, Node.js, and databases.
ED49CF2609
ReplyDeletekiralık hacker
hacker arıyorum
kiralık hacker
hacker arıyorum
belek