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

Add 6.3 support #325

Closed johnpmitsch closed 6 years ago

johnpmitsch commented 6 years ago

This adds an ansible module to check the metadata file in the backup for a specific version. Because metadata.yml was added in 6.2.z, the previous check of satellite-answers is kept for older 6.2 backups. Any backup with metadata.yml will use the metadata file as a check.

Todo:

johnpmitsch commented 6 years ago

yee-haw

johnpmitsch commented 6 years ago

@evgeni If you have a minute to look at this from an ansible + python perspective, that would be awesome :smile:

evgeni commented 6 years ago

Is there a reason you do a "check for version" (twice) instead of "get the version"? plus, you're looking at the katello version, you could also look at the satellite rpm?

evgeni commented 6 years ago

I think I'd make the module in a way, that it gets the path to a config tarball, and unarchive, read etc all happens in the module, and the return is [6.3, 6.2, 'unknown'], and if it's unknown, you can assume 6.1 later.

evgeni commented 6 years ago

oh, the unarchive is not for the metadata, me--

johnpmitsch commented 6 years ago

@evgeni Do you think I should check both satellite rpm + katello plugin version? Maybe I should just check the satellite rpm as that is the version I need in the first place.

My only concern is grabbing another satellite rpm (like satellite-cli) by mistake, but I should be able to put together some regex to match :)

johnpmitsch commented 6 years ago

return is [6.3, 6.2, 'unknown'], and if it's unknown, you can assume 6.1 later

I like returning a string with the version instead of the t/f check for version. 6.1 backups don't have metadata.yaml files (and older 6.2 z streams) so I would probably error if the module doesn't find 6.3 or 6.2 when there is a metadata file present.

evgeni commented 6 years ago

Given this is satellite-clone (and not katello-clone), I'd just check the satellite RPM and ignore katello.

johnpmitsch commented 6 years ago

@evgeni updated the module to check the satellite rpm if you can take a look

johnpmitsch commented 6 years ago

yee-haw

sthirugn commented 6 years ago

Testing in progress Completed:

Also, need https://github.com/RedHatSatellite/satellite-clone/issues/329 to be resolved in this PR.

johnpmitsch commented 6 years ago

@evgeni friendly poke, can you take another glance over the code? :pray:

evgeni commented 6 years ago

@johnpmitsch added some comments, nothing major

johnpmitsch commented 6 years ago

@evgeni updated

johnpmitsch commented 6 years ago

yee-haw

sthirugn commented 6 years ago

Update satellite-clone.md to reflect the fact that metadata.yml is mandatory for 6.3 and above

Edit: created an issue to track this: https://github.com/RedHatSatellite/satellite-clone/issues/329

sthirugn commented 6 years ago

updated test status in comment https://github.com/RedHatSatellite/satellite-clone/pull/325#issuecomment-372759142

johnpmitsch commented 6 years ago

yee-haw

sthirugn commented 6 years ago

ACK

johnpmitsch commented 6 years ago

yee-haw

johnpmitsch commented 6 years ago

@evgeni good point, here is hammer BZ and cpdb_done RFE for katello