-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
New module - elb_target #26483
New module - elb_target #26483
Conversation
The test
|
""" | ||
|
||
try: | ||
return connection.describe_target_health(TargetGroupArn=tg_arn, Targets=target)['TargetHealthDescriptions'][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the TargetHealthDescriptions are an empty list this will fail. Maybe check if it exists and if not return an empty dict?
Traceback:
The full traceback is:
Traceback (most recent call last):
File "/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py", line 245, in <module>
main()
File "/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py", line 242, in main
deregister_target(connection, module)
File "/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py", line 205, in deregister_target
target_descriptions = describe_targets(connection, module, target_group_arn, [])
File "/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py", line 125, in describe_targets
return connection.describe_target_health(TargetGroupArn=tg_arn, Targets=target)['TargetHealthDescriptions'][0]
IndexError: list index out of range
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py\", line 245, in <module>\n main()\n File \"/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py\", line 242, in main\n deregister_target(connection, module)\n File \"/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py\", line 205, in deregister_target\n target_descriptions = describe_targets(connection, module, target_group_arn, [])\n File \"/var/folders/by/k8_fbl593dlctgqmwq5wzl2c0000gn/T/ansible_mqh88b9h/ansible_module_elb_target.py\", line 125, in describe_targets\n return connection.describe_target_health(TargetGroupArn=tg_arn, Targets=target)['TargetHealthDescriptions'][0]\nIndexError: list index out of range\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}
PLAY RECAP *************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what if the target has been registered on multiple ports (since running the playbook with a new port doesn't deregister the target with the old port)? Should those be in the returned info as well, instead of just the first item in the list?
d827df7
to
e87a229
Compare
@wimnat I've been using this module and encountered an issue with the way you are handling existing targets, attempting to register or deregister an existing target causes an exception. In both As the |
Componentslib/ansible/modules/cloud/amazon/elb_target.py test/integration/targets/elb_target/aliases test/integration/targets/elb_target/defaults/main.yml test/integration/targets/elb_target/tasks/main.yml Metadatawaiting_on: wimnat |
!needs_revision |
testing locally. |
fixes my objection. |
Remove exception handling around boto3_conn Add BotoCoreError handling Remove e.message since it isn't available on Python3 Fix waiter to not use 'while True' Fix deregistering targets from used target groups Fix waiting for unused state for targets that have started deregistering
8b88faf
to
82ec532
Compare
The bot was needs revision because there was an @ in a commit message. I rebased to remove that from the commit message. |
@Constantin007 @Constantin07 @Deepakkothandan @Etherdaemon @Java1Guy @Lujeni @Madhura-CSI @MichaelBaydoun @Sodki @adq @akazakov @alachaum @amir343 @anryko @bekelchik @bpennypacker @brandond @carsongee @defunctio @dkhenry @fiunchinho @fivethreeo @garethr @gunzy83 @gurumaia @hsingh @hyperized @iiibrad @infectsoldier @j-carl @jarv @Java1Guy @jimbydamonk @jmenga @joelthompson @jonhadfield @jonmer85 @joshsouza @jsdalton @jsmartin @kaczynskid @leedm777 @linuxdynasty @loia @lwade @MichaelBaydoun @michaeljs1990 @minichate @mjschultz @mmochan @nadirollo @nand0p @naslanidis @nickball @orthanc @piontas @pjodouin @prasadkatti @psykotox @pwnall @raags @rickmendes @roadmapper @ryansydnor @scicoin-project @scottanderson42 @shepdelacreme @silviud @steynovich @tastychutney @tedder @tgerla @timmahoney @tombamford @tsiganenok @viper233 @whiter @wilvk @zacblazic @zbal @zeekin @zimbatm As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add |
SUMMARY
New module - elb_target
ISSUE TYPE
COMPONENT NAME
elb_target
ANSIBLE VERSION
ADDITIONAL INFORMATION
@willthames @s-hertel