rhtconsulting / rhc-ose

OpenShift Automation and Utilities by Red Hat Consulting
42 stars 34 forks source link

Add enhancements for for terminate playbook #197

Closed vvaldez closed 8 years ago

vvaldez commented 8 years ago

What does this PR do?

The following use cases were identified during testing of PR #196 and submitted separately here.

Call terminate.yml as normal and if desired manually introduce the following scenarios:

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

etsauer commented 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.

vvaldez commented 8 years ago

@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?

etsauer commented 8 years ago

@vvaldez you can re-create the issue by passing an incorrect value for ansible_ssh_user to the playbook

vvaldez commented 8 years ago

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.

etsauer commented 8 years ago

lgtm