quads icon indicating copy to clipboard operation
quads copied to clipboard

[RFE]: Enhancements to quads-cli and foreman.py to choose future OS for cloud deployment

Open sadsfae opened this issue 5 years ago • 0 comments

In /opt/quads/conf/quads.yml we have a value that defines what OS gets deployed to future systems when they are scheduled:

foreman_default_os: "RHEL 7"

This RFE covers first letting us set another OS other than the default for a future cloud and also listing available options via quads-cli but should also coincide with passing/retaining this request from our internal request process into our scheduling workflow.

Below covers the technical implementation for QUADS.

Proposal and Approach

There are three new argparse cli options to be added, both reliant on functionality added to foreman.py`

Additionally, changes to /opt/quads/quads/tools/move_and_rebuild_hosts.py is required to enforce these if set and the /opt/quads/quads/tools/foreman.py changes to enact them.

Argparse Changes

  1. An additional argparse parameter to --define-cloud like quads-cli --define-cloud cloud02 --os "RHEL 8".
  • optional parameter that defaults to whatever to the value of foreman_default_os
  • consults Foreman library to query Foreman when input is given, and sanitize/accept input if it matches one of the available operating systems.
  • Once a cloud is defined with --os this is saved to the cloud object
  1. An additional argparse argument to quads-cli like --ls-os which calls the Foreman library to return a list of available operating systems (like hammer os list).
  • returns the hammer os list title as it appears from Foreman
  • we don't want to store this in Mongo as it can change in Foreman
  1. Argparse for quads-cli --ls-cloud-os to list what OS each cloud is set to, if none is set the default for foreman_default_os is returned which would be stored in MongoDB.

Supporting Provisioning Changes

  1. Change to move_and_rebuild_hosts.py so that if --define-cloud is passed the new option of --os $OS_LIST_CHOICE then it will perform an additional call to foreman.py to update all hosts to use that choice instead when mark to build is run.

https://github.com/redhat-performance/quads/blob/master/quads/tools/move_and_rebuild_hosts.py#L177

sadsfae avatar Mar 05 '20 21:03 sadsfae