Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write an ansible playbook to automate the starting of ec2 instance.



Write an ansible playbook to automate the starting of ec2 instance...

Answer / Sitesh Kumar

To start an EC2 instance using Ansible, you first need to set up an inventory file with your AWS credentials and the instance details. Here's a simple example of an Ansible playbook that starts an EC2 instance:nn```yamln- name: Start EC2 instancen hosts: my_ec2_instancesnn tasks:n - name: Wait for EC2 instance to be runningn amazon.aws.wait_for_instance:n instance_ids: '{{ instance_id }}'nn - name: Start the EC2 instancen amazon.aws.ec2: n region: us-west-2n instance_id: '{{ instance_id }}'n state: runningn register: ec2_startednn vars:n - name: instance_idn value: i-0123456789abcdef0

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ansible Interview Questions

How can you connect other devices within ansible?

1 Answers  


Compare ansible vs puppet?

1 Answers  


When should I use {{ }}?

1 Answers  


What are the ansible modules?

1 Answers  


Why are you attracted to science and science fiction?

0 Answers  


What is the best way to make content reusable/redistributable?

1 Answers  


How do I keep secret data in my playbook?

1 Answers  


Is ansible is an open source tool?

1 Answers  


How do I loop over a list of hosts in a group, inside of a template?

1 Answers  


Describe your newsletter ansible and who it’s aimed at.

1 Answers  


How do I handle python pathing not having a python 2.x in /usr/bin/python on a remote machine?

1 Answers  


How do I access a variable name programmatically?

0 Answers  


Categories