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

Compare ansible vs puppet?

1 Answers  


Where does the configuration file live and what can I configure in it?

1 Answers  


How can looping be done over a list of hosts in a group, inside of a template?

1 Answers  


What is the use of ansible?

1 Answers  


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

1 Answers  


How should one configure a jump host to access servers that I have no direct access to?

1 Answers  


How does ansible work?

1 Answers  


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

1 Answers  


What is ansible and what makes it stand out from the rest of the configuration management tools?

1 Answers  


How do I disable cowsay?

1 Answers  


What does fact mean in ansible?

1 Answers  


Why are you attracted to science and science fiction?

0 Answers  


Categories