redhat-performance/JetSki

JetSki does not update ocpinv.json if cloud is changed

RobertKrawitz opened this issue · 2 comments

If ocpinv.json exists, it is always used even if the cloud and lab are changed in group_vars. This could result in smashing somebody else's cluster.

I also don't believe that the cloud names are tied permanently to a fixed set of machines; they are reconfigured as needed. So one might get the same cloud ID for two different allocations, with the same result.

Unless the intent is that people be able to customize ocpinv.json, simply re-downloading it on each run might be safest. If the intent is that people be allowed to customize it, keep a cached copy as a golden master with the following rules:

  1. If the golden master is identical to the download, use the existing working copy as is.
  2. If the golden master differs from the download, and the golden master is identical to the working copy, replace both the working copy and the golden master with the download.
  3. If all three files are different, warn the user that the ocpinv.json file has been modified, and that it is out of date, and instruct the user to reapply the edits.

@RobertKrawitz Thanks for raising this issue. yes, the JSON file is stored in local to let user to change the order of inventory to choose provisioning, master, worker nodes, but the file content is going to be the same. I don't think user can customize anything else directly on this file, @smalleni correct me pls.
So we can add a logic to compare the local(working copy) and remote(downloaded) inventory and alert user if there is any conflict during any playbook execution. I don't see a need for another json file as golden master, could you please explain if I am missing something.

That's fine -- just mention that the working copy is stale and unless one knows what they're doing they should remove the working copy.