RedHatSatellite / satellite-clone

Utility to assist cloning an existing Satellite 6 server to a new host
GNU General Public License v3.0
37 stars 31 forks source link

disassociate_capsules.rb failure is not shown in ansible-playbook output #176

Open sthirugn opened 7 years ago

sthirugn commented 7 years ago

Any failure in disassociate_capsules.rb should propogate as failure in the corresponding ansible-playbook task. Currently it fails silently and it can be easily overlooked.

sthirugn commented 7 years ago

sample failure:

TASK [satellite-clone : Disassociate capsules with lifecycle environments (to avoid the cloned Satellite server talking with live capsules)] ***
Friday 07 April 2017  12:58:35 -0400 (0:00:00.026)       0:56:25.277 ********** 
changed: [localhost]

stdout: All Capsules are unassociated with any lifecycle environments. This is to avoid any syncing errors with your original Satellite and any interference with existing infrastructure. To reverse these changes, run the following commands, making sure to replace the credentials with your own.
hammer -u admin -p changeme --csv capsule content add-lifecycle-environment --id 2 --environment QE --organization "S?o Paulo"
hammer -u admin -p changeme --csv capsule content add-lifecycle-environment --id 3 --environment QE --organization "S?o Paulo"

stderr: Could not remove the lifecycle environment from the capsule:
  Error: lifecycle_environment not found
Could not remove the lifecycle environment from the capsule:
  Error: lifecycle_environment not found
johnpmitsch commented 7 years ago

Need exit code on the script