neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

MrackConfig: improve the approach to be object based and easy to extend #55

Closed pvoborni closed 3 years ago

pvoborni commented 3 years ago

base on PR: https://github.com/neoave/mrack/pull/36

This commit implements a MrackConfig which allows to define options and arguments otherwise needed in a configuration file and thus save people's time with writing them in CLI.

Config file looks like:

[mrack]
mrackdb = config/mrackdb.yaml
provisioning-config = config/provisioning-config.yaml
metadata = config/metadata.yaml

Where each value is optional and existance of the config is also optional.

Mrack looks for the config on these locations:

It also changes CLI of commands:

With these changes it is possible to define a config file to allow just typing:

$ mrack up
$ mrack list
$ mrack ssh
$ mrack output
$ mrack destroy

The MrackConfig class is also extensible for new use cases.

Signed-off-by: Petr Vobornik pvoborni@redhat.com