Closed vvaldez closed 8 years ago
@vvaldez first off, since we merged your other terminate enhacement, this PR needs updating.
Second, I tried running on a set of instances that are "unreachable" in the subscription-manager task. the terminate failed and the instances are still around.
@etsauer can you post the result of nova list for these instances or are they still around? How can I replicate this unreachable state or do you have the playbook run result?
@vvaldez you can re-create the issue by passing an incorrect value for ansible_ssh_user to the playbook
The issue was two fold here. First the grep was improperly capturing a | when the Floating IP didn't exist. Secondly, since this was used in the host group the subscription-manager task failed since it obviously can't reach a host with that name. This can also occur as noted in Issue #206 when the instance can't be reached. Addressed these issues in the latest commit by fixing the grep and also added prompt (at @etsauer request) and unregister variables set to true by default but can be overridden. In case an instance should not attempt to unregister this can be set to false to bypass this task.
lgtm
What does this PR do?
The following use cases were identified during testing of PR #196 and submitted separately here.
How should this be manually tested?
Call terminate.yml as normal and if desired manually introduce the following scenarios:
Is there a relevant Issue open for this?
None, though optionally the ansible_ssh_user can be omitted and the user would need to specify this outside the playbook. I changed this to cloud-user as it is the most commonly used user for the cloud guest image.
Who would you like to review this?
/cc @oybed @etsauer @sabre1041