Browse Source

Added support for CentOS 8 (#47)

* Added support for CentOS 8

* Make CentOS 6 the default distribution
pull/49/head
Hoel IRIS 6 years ago committed by GitHub
parent
commit
f254f80638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      README.md
  2. 17
      kvm-install-vm
  3. 8
      tests/check_distributions.bats
  4. 2
      tests/check_script.bats

3
README.md

@ -82,7 +82,7 @@ OPTIONS
-M Mac address (default: auto-assigned)
-p Console port (default: auto)
-s Custom shell script
-t Linux Distribution (default: centos7)
-t Linux Distribution (default: centos8)
-T Timezone (default: US/Eastern)
-u Custom user (defualt: $USER)
-v Be verbose
@ -93,6 +93,7 @@ DISTRIBUTIONS
centos7 CentOS 7 centos
centos7-atomic CentOS 7 Atomic Host centos
centos6 CentOS 6 centos
centos8 CentOS 8 centos
debian9 Debian 9 (Stretch) debian
fedora27 Fedora 27 fedora
fedora27-atomic Fedora 27 Atomic Host fedora

17
kvm-install-vm

@ -61,7 +61,7 @@ function usage_subcommand ()
printf " -M Mac address (default: auto-assigned)\n"
printf " -p Console port (default: auto)\n"
printf " -s Custom shell script\n"
printf " -t Linux Distribution (default: centos7)\n"
printf " -t Linux Distribution (default: centos8)\n"
printf " -T Timezone (default: US/Eastern)\n"
printf " -u Custom user (default: $USER)\n"
printf " -y Assume yes to prompts (default: false)\n"
@ -71,6 +71,7 @@ function usage_subcommand ()
printf "DISTRIBUTIONS\n"
printf " NAME DESCRIPTION LOGIN\n"
printf " amazon2 Amazon Linux 2 ec2-user\n"
printf " centos8 CentOS 8 centos\n"
printf " centos7 CentOS 7 centos\n"
printf " centos7-atomic CentOS 7 Atomic Host centos\n"
printf " centos6 CentOS 6 centos\n"
@ -84,7 +85,7 @@ function usage_subcommand ()
printf "\n"
printf "EXAMPLES\n"
printf " $prog create foo\n"
printf " Create VM with the default parameters: CentOS 7, 1 vCPU, 1GB RAM, 10GB\n"
printf " Create VM with the default parameters: CentOS 8, 1 vCPU, 1GB RAM, 10GB\n"
printf " disk capacity.\n"
printf "\n"
printf " $prog create -c 2 -m 2048 -d 20 foo\n"
@ -294,6 +295,14 @@ function fetch_images ()
DISK_FORMAT=qcow2
LOGIN_USER=ec2-user
;;
centos8)
QCOW=CentOS-8-GenericCloud-8.1.1911-20200113.3.x86_64.qcow2
OS_TYPE="linux"
OS_VARIANT="centos8"
IMAGE_URL=https://cloud.centos.org/centos/8/x86_64/images
DISK_FORMAT=qcow2
LOGIN_USER=centos
;;
centos7)
QCOW=CentOS-7-x86_64-GenericCloud.qcow2
OS_TYPE="linux"
@ -472,7 +481,7 @@ function set_cloud_init_remove ()
centos6 )
CLOUDINITDISABLE="chkconfig cloud-init off"
;;
centos7|amazon?|fedora??|ubuntu*|debian? )
centos8|centos7|amazon?|fedora??|ubuntu*|debian? )
CLOUDINITDISABLE="systemctl disable cloud-init.service"
;;
*-atomic)
@ -784,7 +793,7 @@ function set_defaults ()
VMDIR=${HOME}/virt/vms # Directory to store virtual machines
BRIDGE=virbr0 # Hypervisor bridge
PUBKEY="" # SSH public key
DISTRO=centos7 # Distribution
DISTRO=centos8 # Distribution
MACADDRESS="" # MAC Address
PORT=-1 # Console port
TIMEZONE=US/Eastern # Timezone

8
tests/check_distributions.bats

@ -32,6 +32,14 @@ function remove_test_vm ()
remove_test_vm centos7-atomic
}
@test "Install VM (CentOS 8) - $VMNAME-centos8" {
create_test_vm centos8
}
@test "Delete VM (CentOS 8) - $VMNAME-centos8" {
remove_test_vm centos8
}
@test "Install VM (Fedora 29) - $VMNAME-fedora29" {
create_test_vm fedora27
}

2
tests/check_script.bats

@ -23,7 +23,7 @@ load vmname
[[ "${lines[0]}" =~ "NAME" ]]
}
@test "Install VM (CentOS7) - $VMNAME" {
@test "Install VM (CentOS8) - $VMNAME" {
run kvm-install-vm create $VMNAME
[ "$status" -eq 0 ]
}

Loading…
Cancel
Save