Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to custom list of distros #51

Open
seocam opened this issue Mar 26, 2020 · 2 comments
Open

Add support to custom list of distros #51

seocam opened this issue Mar 26, 2020 · 2 comments

Comments

@seocam
Copy link
Contributor

seocam commented Mar 26, 2020

My use case for kvm-install-vm is to perform test run in multiple versions of a given distro (centos, fedora and rhel). While I don't think it would make sense to create a PR to add centos-1611, centos1811, centos1907, etc., those names are meaningful and helpful in my tests.

For that reason I'd like to suggest that the mapping of distros could be customized in .kvirc or somewhere else.

Thanks!

@seocam seocam changed the title Support to custom list of distros Add support to custom list of distros Mar 26, 2020
@giovtorres
Copy link
Owner

Would you be able to walk me through how you would implement this feature?

@seocam
Copy link
Contributor Author

seocam commented Mar 29, 2020

There probably many ways it could be done. One example would be to take an argument of a json file with the distro definition and parse it using jq (available in most debian-based and rpm-based distros).

For this file:

{
    "centos8": {
        "qcow": "CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2",
        "os_variant": "centos8",
        "image_url": "https://cloud.centos.org/centos/8/x86_64/images",
        "disk_format": "qcow2",
        "login_user": "centos"
    }
}

You could read the settings like this:

$ cat distros.json | jq .centos8.qcow
"CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2"

I've made this gist with all "distro variables" read using jq:
https://gist.github.com/seocam/e0e6ff8e4b2b26884cda1ca046ec5921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants