Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud/ec2_elb module - Deregister an instance even if its already OutOfService #7131

Merged
merged 2 commits into from Apr 29, 2014
Merged

Conversation

bpennypacker
Copy link
Contributor

Issue Type:

Bugfix Pull Request

Ansible Version:

ansible 1.6 (devel 2be8fee) last updated 2014/04/22 18:45:33 (GMT +000)

Environment:

N/A

Summary:

The current behavior of the ec2_elb module does not match the documentation. If an EC2 instance is registered with the ELB, but it's current state is OutOfService, then "state=absent" does nothing. The instance remains registered with the ELB.

Steps To Reproduce:

Create an AWS EC2 instance. Create an ELB instance and associate the EC2 instance with it. Ensure the instance is listed as OutOfService in the ELB (no need for anything to be running on the EC2 instance). Use the ec2_elb module as follows:

ec2_elbs=<name of ELB>
instance_id=<id of EC2 instance>
state=absent
Expected Results:

The instance should be removed from the ELB

Actual Results:

The instance is ignored because it is in the OutOfService state. This pull request changes the behavior to be what is actually expected. This change basically boils down to:

  • If the instance is not found in the ELB then simply return with changed=false
  • If the instance is found in the ELB, no matter the state (InService or OutOfService), deregister it from the ELB and return changed=true

…B then simply return 'changed=false'. Otherwise always remove the instance from the ELB no matter what state its currently in.
@jimi-c jimi-c added P2 labels Apr 23, 2014
@jimi-c jimi-c merged commit dc912ca into ansible:devel Apr 29, 2014
@jimi-c
Copy link
Member

jimi-c commented Apr 29, 2014

Merged, thanks!

@bpennypacker bpennypacker deleted the elb branch April 29, 2014 13:38
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. cloud P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants