Playbook to add ec2 instance to ELB

0 votes
How do I write a playbook to add an ec2 instance to ELB?
Mar 26, 2019 in Ansible by kishore
583 views

1 answer to this question.

0 votes

Hey, @Kishore, try something like this:

- hosts: localhost
  tasks:
    - name: Add each EC2 instance to the ELB
      ec2_elb:
        state: present
        ec2_elbs: load-balancer
        region: us-west-1
        instance_id: "{{ item.id }}"
      with_items: "{{ ec2_instances.tagged_instances }}"
answered Mar 26, 2019 by Yesha

Related Questions In Ansible

0 votes
1 answer

Ansible playbook to automate security configurations of an EC2 instance

Hey @Kiara, your indentation is very wrong. ...READ MORE

answered Jan 24, 2019 in Ansible by Harsh
794 views
0 votes
0 answers

Error while executing playbook to start ec2 instance

I have a playbook that starts an ...READ MORE

Mar 29, 2019 in Ansible by Kalgi
1,118 views
0 votes
1 answer

Playbook to start ec2 instance

- name: Create an ec2 instance ...READ MORE

answered Apr 9, 2019 in Ansible by Kalgi
611 views
0 votes
1 answer

How to launch an EC2 instance using Ansible Playbook?

Hi@akhtar, Ansible has one module named ec2. This ...READ MORE

answered Aug 12, 2020 in Ansible by MD
• 95,460 points
2,042 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,706 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,024 views
0 votes
1 answer

Store ec2 instance IP using ansible playbook

Hey @Himanshu, you can use something like ...READ MORE

answered Mar 25, 2019 in Ansible by Yesha
3,448 views
0 votes
1 answer

Playbook to add hosts to the known hosts list - Ansible

Hey @Kiran, try something like this: - name: ...READ MORE

answered Mar 26, 2019 in Ansible by Haider
3,315 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP